Need script or method to create a sitemap or site index

211 views
Skip to first unread message

BBunny

unread,
Jan 15, 2011, 3:02:12 AM1/15/11
to BBEdit Talk
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.

Stefano

unread,
Jan 18, 2011, 1:38:29 AM1/18/11
to BBEdit Talk
"The "Misc" menu on the Markup menu, and the commands on it, have
outlived their usefulness and been removed."
I can't just understand their debatable usefulness. I think Index
Document, Index Folder and Site were rather useful instead.
Maybe you know, now there is a Folder Listing (Edit -> Insert ->
Folder Listing). But then you have to add links with a careful search
and replace.

BBunny

unread,
Jan 19, 2011, 1:21:37 AM1/19/11
to BBEdit Talk
I agree—I found the site index a very useful feature. If they don't
want to include it in the product, at least they could make it a user-
activated option. I wasn't aware of the folder listing feature, but
having to insert links manually sounds tedious. I'll check it out,
though. Thanks for the info.

Stefano

unread,
Jan 19, 2011, 6:27:43 PM1/19/11
to BBEdit Talk
On 19 Gen, 07:21, BBunny <fran...@cherman.com> wrote:
> I agree—I found the site index a very useful feature. If they don't
> want to include it in the product, at least they could make it a user-
> activated option. I wasn't aware of the folder listing feature, but
> having to insert links manually sounds tedious. I'll check it out,
> though. Thanks for the info.

... or you could try to run 8.7.2 with the old Misc Menu. As I
did ... .-)

BBunny

unread,
Mar 19, 2011, 12:46:23 AM3/19/11
to BBEdit Talk
Interesting thought. Can you keep 8.7.2 on the disk with the current
version, or does that mess things up?

On Jan 19, 4:27 pm, Stefano <stefano....@gmail.com> wrote:
> On 19 Gen, 07:21, BBunny <fran...@cherman.com> wrote:
>
> > I agree—I found the site index a very useful feature. If they don't
> > want to include it in the product, at least they could make it a user-
> > activated option. I wasn't aware of the folder listing feature, but
> > having to insertlinksmanually sounds tedious. I'llcheckit out,

Tim Gray

unread,
Mar 20, 2011, 12:05:25 PM3/20/11
to BBEdit Talk

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.

G. T. Stresen-Reuter

unread,
Mar 20, 2011, 1:35:37 PM3/20/11
to bbe...@googlegroups.com
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

Charlie Garrison

unread,
Mar 20, 2011, 9:57:18 PM3/20/11
to bbe...@googlegroups.com
Good afternoon,

On 20/03/11 at 12:05 PM -0400, Tim Gray <tg...@125px.com> 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 ♊ <garr...@zeta.org.au>

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

Doug McNutt

unread,
Mar 20, 2011, 10:33:13 PM3/20/11
to bbe...@googlegroups.com
At 12:57 +1100 3/21/11, Charlie Garrison wrote:
>Good afternoon,
>
>On 20/03/11 at 12:05 PM -0400, Tim Gray <tg...@125px.com> 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 <--

Tim Gray

unread,
Mar 21, 2011, 12:25:45 AM3/21/11
to bbe...@googlegroups.com
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...

Charlie Garrison

unread,
Mar 21, 2011, 1:48:03 AM3/21/11
to bbe...@googlegroups.com
Good afternoon,

On 21/03/11 at 12:25 AM -0400, Tim Gray <tg...@125px.com> 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.

Tim Gray

unread,
Mar 21, 2011, 2:36:31 AM3/21/11
to bbe...@googlegroups.com
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.

Rich Siegel

unread,
Mar 21, 2011, 8:27:45 AM3/21/11
to bbe...@googlegroups.com
On Monday, March 21, 2011, Charlie Garrison
<garr...@zeta.org.au> 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.

When you run a script or filter from the #! menu, BBEdit sets up
some variables in the environment, one of which is BB_DOC_PATH,
the path to the front document. (This was introduced in 9.3, so
you can find more details in the 9.3 change notes at
<http://www.barebones.com/support/bbedit/arch_bbedit93.html>, as
well as in the user manual.)

If you're running a script outside of BBEdit, then the example
above is definitely useful and helpful.

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.

Maarten Sneep

unread,
Mar 21, 2011, 8:47:59 AM3/21/11
to bbe...@googlegroups.com
On Mon, 21 Mar 2011 08:27:45 -0400, Rich Siegel wrote:
> On Monday, March 21, 2011, Charlie Garrison <garr...@zeta.org.au>
> 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.
>
> When you run a script or filter from the #! menu, BBEdit sets up some
> variables in the environment, one of which is BB_DOC_PATH, the path
> to
> the front document. (This was introduced in 9.3, so you can find more
> details in the 9.3 change notes at
> <http://www.barebones.com/support/bbedit/arch_bbedit93.html>, as well
> as in the user manual.)
>
> If you're running a script outside of BBEdit, then the example above
> is definitely useful and helpful.

What's more, the above will probably not return if called in a script
which is invoked from the #! menu. BBEdit does not process AppleEvents
while running #! scripts - this includes using appscript from python or
ruby.

if [ -z "$BB_DOC_PATH' ]
then
FRONT_DOC=$(osascript -e 'tell application "BBEdit" to get POSIX
path of ((file of front document) as string)')
else
FRONT_DOC=$BB_DOC_PATH
fi

(and yes, there are more fancy methods with {}?!- and other characters
thrown in for good measure. This is somewhat readable ;-)

Maarten

Tim Gray

unread,
Mar 21, 2011, 2:49:47 PM3/21/11
to bbe...@googlegroups.com
On Mar 21, 2011 at 08:27 AM -0400, Rich Siegel wrote:
> When you run a script or filter from the #! menu, BBEdit sets up some
> variables in the environment, one of which is BB_DOC_PATH, the path to the
> front document.

As far as I can tell, these variables are only implemented for filters and
not scripts. Note, I run my scripts in Terminal, which might affect this.

Scratch that - if I set scripts to not run in Terminal, I do indeed pick up
the right variables. Thanks.

LuKreme

unread,
Mar 22, 2011, 10:52:12 AM3/22/11
to bbe...@googlegroups.com
/bin/myscript | bbedit

Works for me

Sent from my iPad

Tim Gray

unread,
Mar 22, 2011, 11:40:37 AM3/22/11
to bbe...@googlegroups.com
On Mar 22, 2011 at 08:52 AM -0600, LuKreme wrote:
> /bin/myscript | bbedit
>
> Works for me

Not if you run your script from the #! menu in BBEdit and have it "Run in
Terminal" set.

BBunny

unread,
Mar 23, 2011, 4:55:09 AM3/23/11
to BBEdit Talk
G.T., thanks for the link. I spent several hours today working with it
(I'm not a command-line person—can you tell?). It works well, but it's
just not user-friendly enough for my level of knowledge. But I
appreciate the thought.

On Mar 20, 10:35 am, "G. T. Stresen-Reuter" <tedmaster...@gmail.com>
wrote:

BBunny

unread,
Mar 23, 2011, 4:58:23 AM3/23/11
to BBEdit Talk
Forgive my lack of experience with scripts, but are we still talking
about something that will create a site index? If so, can you tell me
exactly what I would enter, and where? Thanks.

Robert Huttinger

unread,
Mar 20, 2011, 6:57:58 PM3/20/11
to bbe...@googlegroups.com
it's true that AppleScript may be a new Lang to learn, but it's pretty
damn easy with millions of example code on the web. it may be a lot
easierthan you think!

Sent from my Apple ][

> --
> 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 bbe...@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+un...@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem,
> please email "sup...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Christopher Stone

unread,
Mar 21, 2011, 3:41:11 AM3/21/11
to bbe...@googlegroups.com
On Mar 21, 2011, at 01:36, Tim Gray wrote:
> 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.

______________________________________________________________________

Hey Tim,

http://appscript.sourceforge.net/

You can bridge all of BBEdit's Applescript dictionary to Python or Ruby.

I haven't fooled with this, but others have extolled the virtues of appscript.

--
Best Regards,
Chris

Charlie Garrison

unread,
Mar 23, 2011, 6:41:10 PM3/23/11
to bbe...@googlegroups.com
Good morning,

On 21/03/11 at 2:41 AM -0500, Christopher Stone
<listm...@thestoneforge.com> wrote:

>http://appscript.sourceforge.net/
>
>You can bridge all of BBEdit's Applescript dictionary to Python or Ruby.

It doesn't seem to be listed at the above site, but there is
also an AppleEvents (which is really what AppleScript is) bridge
for Perl. And I think there is another for Obj-C which pretty
much any scripting language should be able to tie in to.

So yes, one is certainly not limited to AppleScript in order to
talk to and control other apps.

BBunny

unread,
Mar 24, 2011, 1:03:00 AM3/24/11
to BBEdit Talk
Be that as it may, I'm asking if a method has been mentioned here that
would create a sitemap in BBEdit (or terminal), and, if so, exactly
what one would enter, and where. Thanks.

On Mar 20, 3:57 pm, Robert Huttinger <roberthuttin...@gmail.com>
wrote:
> > please email "supp...@barebones.com" rather than posting to the group.

François Schiettecatte

unread,
Mar 24, 2011, 5:51:37 AM3/24/11
to bbe...@googlegroups.com
There are online tools for doing this, why not use there, I did a quick google search and found this:

http://www.xml-sitemaps.com/

Here a bunch of other links that a colleague collected a while back:

1. Server-side tool kits available for 32/64 bit OS for Windows and Linux, written in PHP, Perl and Python. Two examples:
a. Paid: http://www.softswot.com/sitemapinfo.php
b. Free: http://www.smart-it-consulting.com/article.htm?node=154&amp;page=82


2. Extensions and plugins for CMS, development platforms and publishing platforms such as .Net, Drupal and WordPress. Two examples:
a. Paid: http://www.pc4people.com/products.php?cat=57
b. Free: http://drupal.org/project/xmlsitemap


3. Applications that can be downloaded for free, or for a fee. Two examples:
a. Paid: http://www.sitemappro.com/
b. Free: http://www.vigos.com/products/gsitemap/


4. On-line services that will ingest your web site and create an XML-Sitemap. Two examples:
a. Paid: http://www.autositemap.com/
b. Free: http://www.xml-sitemaps.com/


5. Class libraries available for Java, Perl, ASP and PHP. Two examples:
a. Free: http://www.phpclasses.org/browse/package/2612.html
b. Free: http://www.iteam5.net/francesco/sitemap_gen/

Cheers

François

> please email "sup...@barebones.com" rather than posting to the group.

captkirk

unread,
Dec 8, 2013, 4:32:05 PM12/8/13
to bbe...@googlegroups.com
I looked at all the suggestions posted and none really fit the bill. Google searches have HTML 'displayable' and Google XML search submission site maps all mixed up, as do a lot of the suggestions on this thread.

Any new info on this?

Robert A. Rosenberg

unread,
Dec 9, 2013, 4:13:18 PM12/9/13
to bbe...@googlegroups.com, captkirk
What is wrong with http://www.xml-sitemaps.com/? It creates the Suite Maps you are looking for.
--
This is the BBEdit Talk public discussion group. If you have a

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

Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
 
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.


Greg Raven

unread,
Dec 11, 2013, 9:11:40 AM12/11/13
to bbe...@googlegroups.com
Matterform Media used to offer a great one under OS9, but it didn't make the transition to OS X. Searching the web for "hierarchical HTML site map" shows there to be not many options, and none of them that I found actually worked.

Google still advises you to use a hierarchical site map, both to ensure that all pages on your site are reachable, and to flatten the hierarchy of your site for crawling purposes. There's no way, though, that I'm going to start with BBEdit's indented text listing of files and manually add links!

Ted Burger

unread,
Dec 11, 2013, 9:19:44 AM12/11/13
to bbe...@googlegroups.com
Folks,

I do not do it in BBedit, instead I use Sitemap Automator to create my sitemap files.
You give it a url and it builds a sitemap for it.
https://www.macupdate.com/app/mac/20569/sitemap-automator
Maybe this will do what you want.

Thanks,
Ted
*********************** Ted Burger ****************************
t...@tobsupport.com ********* www.tobsupport.com


Greg Raven

unread,
Dec 11, 2013, 10:19:57 AM12/11/13
to bbe...@googlegroups.com
I thought the original poster was asking about creating hierarchical HTML site maps.

BBunny

unread,
May 12, 2014, 1:28:54 PM5/12/14
to bbe...@googlegroups.com
Yes, you're correct. The original author (me) was asking how to create hierarchical html sitemaps. :-)

Lawrence San

unread,
May 12, 2014, 3:16:19 PM5/12/14
to BBEdit-Talk
If I can step back a bit, what is the typical purpose of automatically generated sitemap files?

When I create site maps, I do so by hand in HTML, including only the relevant (main, important, or section-entry) pages, organized by navigational logic -- which is not always the same as the directory organization of the site files. I assume that these auto-sitemap or index tools being discussed here strictly follow the directory organization and include everything (or everything down to a certain level you specify), right? Does this have something to do with submitting those files to search engines for indexing... or just as a starting point for hand-crafting a sitemap for your visitors... or are there other uses I'm not aware of?

Lawrence San
Business Writing: Santhology.com
Cartoon Stories for Thoughtful People: Sanstudio.com




Greg Raven

unread,
May 12, 2014, 4:44:05 PM5/12/14
to bbe...@googlegroups.com
They used to be in vogue for giving visitors more-or-less direct access to each page in a site. They were particularly useful back in the days when search engines were just getting started and you wanted to make certain that each page was linked somewhere. IIRC, we were still running OS 9 back then. Of course, back then BBEdit offered the ability to create a one-page linked listing of all pages in a site (no hierarchy), using the page titles. Was sorry to see that one go, too.

These utilities were also helpful for seeing each of your page titles at once, as this helped make certain you didn't have pages with generic or missing titles, and if you had a page-naming scheme, the incorrectly-named pages would stand out so you could fix them.
Reply all
Reply to author
Forward
0 new messages