Re: Need script or method to create a sitemap or site index

2011-03-20 Thread Tim Gray

On Jan 15, 2011 at 12:02 AM -0800, BBunny wrote:

The "Misc" menu in previous versions of BBEdit contained an "index"
feature, which generated a hierarchical index—in other words, a sitemap
—of a Web site, with live links to the pages. With version 9.6, that
feature has been eliminated. Can anyone suggest a script or other easy
way of replacing that function? Thanks much.


I think I could write up a script that does this pretty easily.  The only 
problem is that BBEdit only provides two methods for unix scripts, 'filters' 
and 'scripts'.  Scripts run in Terminal, so it's kind of difficult to get 
the output of said script into a new BBEdit window in an automated fashion. 
Filters run on an existing window and replace the contents.


A third option is to call a unix script from an Applescript.  Applescript 
can obviously open new BBEdit windows, etc., but its kind of kludgy to have 
a parent Applescript call on separate unix script.  You'd have to install 
two files, etc.  Of course, the obvious solution would be to write a 100% 
Applescript script, but for the life of me I can't master Applescript.


So, I can provide you with a Python script that you can run from the command 
line.  You feed it a directory and it will make an index page for the html 
files in that directory.  Would that be useful?


I wish there was tighter integration between BBEdit and scripting languages, 
like Python and Perl.  But there isn't.  If there was, extending BBEdit to 
do tasks like this would be so much easier.  Instead, you have to wrestle 
with Applescript to do anything of the sort.  It's one of the features I'm 
really jealous that Textmate has.


--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: Need script or method to create a sitemap or site index

2011-03-20 Thread G. T. Stresen-Reuter
On Mar 20, 2011, at 4:05 PM, Tim Gray wrote:

> On Jan 15, 2011 at 12:02 AM -0800, BBunny wrote:
>> The "Misc" menu in previous versions of BBEdit contained an "index"
>> feature, which generated a hierarchical index—in other words, a sitemap
>> —of a Web site, with live links to the pages. With version 9.6, that
>> feature has been eliminated. Can anyone suggest a script or other easy
>> way of replacing that function? Thanks much.

Probably not exactly what you want (and may require a web server) but you might 
look at this:

http://www.linklint.org/

There are many other spiders out there and nearly all of them produce some kind 
of report that could be tweaked to make a sitemap (I think).

Ted

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Need script or method to create a sitemap or site index

2011-03-20 Thread Charlie Garrison

Good afternoon,

On 20/03/11 at 12:05 PM -0400, Tim Gray  wrote:

I wish there was tighter integration between BBEdit and 
scripting languages, like Python and Perl.  But there isn't.  
If there was, extending BBEdit to do tasks like this would be 
so much easier.  Instead, you have to wrestle with Applescript 
to do anything of the sort.  It's one of the features I'm 
really jealous that Textmate has.


What sort of integration is missing? What does Textmate do that 
BBEdit doesn't? I run unix scripts (perl in my case) from BBEdit 
every day. Between the Run Script command and worksheets (& 
filters as you mentioned) I don't feel like I'm missing any functionality.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: Need script or method to create a sitemap or site index

2011-03-20 Thread Doug McNutt
At 12:57 +1100 3/21/11, Charlie Garrison wrote:
>Good afternoon,
>
>On 20/03/11 at 12:05 PM -0400, Tim Gray  wrote:
>
>>I wish there was tighter integration between BBEdit and scripting languages, 
>>like Python and Perl.  But there isn't.  If there was, extending BBEdit to do 
>>tasks like this would be so much easier.  Instead, you have to wrestle with 
>>Applescript to do anything of the sort.  It's one of the features I'm really 
>>jealous that Textmate has.
>
>What sort of integration is missing? What does Textmate do that BBEdit 
>doesn't? I run unix scripts (perl in my case) from BBEdit every day. Between 
>the Run Script command and worksheets (& filters as you mentioned) I don't 
>feel like I'm missing any functionality.
>

I donno if it's intended or not but I regularly run perl and shell scripts that 
muck with a file that BBEdit has open. BBEdit recognizes that the underlying 
file has been changed and modifies its display automatically when you make the 
BBEdit  window active again.

BBEdit may complain under some conditions like editing changes that were in 
effect but not saved before you do that so it's a good idea to save before 
running such a script but it's not required and there may be reasons not to.

-- 
--> Give me liberty or give me Obamacare <--

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Need script or method to create a sitemap or site index

2011-03-20 Thread Tim Gray

On Mar 21, 2011 at 12:57 PM +1100, Charlie Garrison wrote:
What sort of integration is missing? What does Textmate do that BBEdit 
doesn't? I run unix scripts (perl in my case) from BBEdit every day. 
Between the Run Script command and worksheets (& filters as you mentioned) 
I don't feel like I'm missing any functionality.


I'd love to be able to call a Unix script (not a filter) that picks what the 
active file is and does something with it.  I don't mean munge the files 
contents, but use the open text file as an argument to a command line 
utility (or whatever else you might do in shell script).  Maybe this is a 
feature that has been added - the last time I checked, scripts were passed 
no real information about what was going on in the GUI.  As far as I know, 
the only way to do this is to write a wrapper Applescript that calls your 
Unix script, with any BBEdit interaction takes place in the Applescript 
layer.


For example, I write a lot of Latex files.  I prefer to do that in BBEdit. 
When it comes time to run the file I'm working on through pdflatex, I can't 
just write a shell script that uses the active document's file path as an 
argument while calling pdflatex.


If you are interested in seeing more, CompileTeX is a suite that someone 
wrote a while back that does exactly this.  The core of the interaction with 
latex is through a shell script, but it has many Applescript bits that call 
the main shell script with various options.


Another example - what if you wanted to copy the currently open file to a 
specified location using a shell script (I know you can do this via 
Applescript).  How would you go about doing that with either Unix filters or 
scripts?


I wish I had more examples ready for you, but over the years I've tried to 
do various things, ran into this, gave up, and forgotten about them.  I will 
say that I am happy with filters and scripts for 90% of the stuff I do.


Hopefully I'm wrong and this kind of thing can now be done...

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: Need script or method to create a sitemap or site index

2011-03-20 Thread Charlie Garrison

Good afternoon,

On 21/03/11 at 12:25 AM -0400, Tim Gray  wrote:

I'd love to be able to call a Unix script (not a filter) that 
picks what the active file is and does something with it.  I 
don't mean munge the files contents, but use the open text file 
as an argument


OK, I missed that part of your question. When I run a script I 
want the script itself to be the active file, so it's a 
no-brainer. I seem to recall needing to run a script ages ago 
that got the front document (which wasn't the script) and I just 
called some AppleScript to do that; pretty easy to add. Assuming 
a shell script (adjust for other languages); it should just be a 
matter of something like:


FRONT_DOC=`osascript -e 'tell application "BBEdit" to get POSIX 
path of ((file of front document) as string)'`


So, not built-in to BBEdit, but just a one-liner to add to 
existing scripts.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: Need script or method to create a sitemap or site index

2011-03-20 Thread Tim Gray

On Mar 21, 2011 at 04:48 PM +1100, Charlie Garrison wrote:
FRONT_DOC=`osascript -e 'tell application "BBEdit" to get POSIX path of 
((file of front document) as string)'`


So, not built-in to BBEdit, but just a one-liner to add to existing 
scripts.


Yes, I remember thinking of this solution.  Unfortunately (at the time at 
least), BBEdit locks out this kind of behavior when called from a script run 
from the Unix menu.  I'll try it again tomorrow.


I seem to recall having a discussion about this with support at some point, 
but can't find the email in my archive.


--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: