Here's a really simple AppleScript I wrote this morning to take a
selection of 

Mr Toad's Wild Ride

and put

mr_toads_wild_ride.txt

on the clipboard for convenient pasting into the save dialog. I can't
believe it took me this long to write the dumb thing, since I do this
all the time for random recipes, blog posts, and various other items
that I write in BBEdit.

to use, copy and paste this into Script Editor ( or Script Debugger )
and save it in your BBEdit Scripts folder. See the BBEdit Manual if this
makes no sense to you. I also gave it a handy key-command of
Shift-Cmd-D. It was physically close to Cmd-S, which is my next command
after this one.

--
tell application "BBEdit"
    set theName to contents of selection
    set theName to change case theName making lower case
    set theName to replace " " using "_" searchingString theName
    set theName to replace "'" using "" searchingString theName
    -- set theName to theName
    set contents of current clipboard to theName & ".txt"
end tell
--

Hopefully someone finds this as useful as I have. There are obvious
improvements like stripping out any shell-escaped characters, but I
don't ever write those in a title, so I did the lazy thing.

Laziness ( I hate typing damn filenames )
Impatience ( I couldn't wait any longer for someone else to solve the
problem )
Hubris ( I think someone might find this useful )

Must be good!

- brian

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to