I’m finally coming to grips with Applescript after what feels like years of floundering. Over recent weeks I’ve invested hours into improving scripts I use in Tex-Edit Plus and am converting some for use in Text Wrangler, both of which are important for me in making and maintaining web sites.
A lot of what I do involves taking text, performing extensive find and replace actions and then putting that text somewhere. The other day my highlight was to take a tab-delimited list prepared in Excel, which contained about 120 lines like this:
114 F100012.JPG Scenery Sunset over Mahia
And to break it into 120 separate text files, each named with the filename from the second column, but with .txt instead of .jpg, and to reformat the remaining text like this:
Order number: 114 Category: Scenery Description: Sunset over Mahia
One problem with living in Wellington, New Zealand, is being able to find training. I’d just love to have a competent trainer teach me what I want to know about Applescript. Although I generally learn well from books and manuals, there are two problems:
- Generally they don’t teach exactly the things you want to know. If I wanted to know how to carry out the above task it’s unlikely to be the example the author used in creating the text book.
- You still have to spend forever reading through the text to glean clues about problems you have. In creating the script mentioned above I spent hours finding answers to questions which a trainer could have answered in seconds. And no, it doesn’t mean my learning was any deeper, more thorough or better that I had to find those answers myself.
These two Appelscripts mentioned recently on scriptbuilders may be useful to someone. It’s certainly interesting to me to see how they’re put together.
Loren Ipsum 1.0 puts a random Loren Ipsum nonsense paragraph onto your clipboard.
Clipboard cleaner removes extraneous spaces, tabs and line breaks from the clipboard, and removes all formatting from the text.
[Via scriptbuilders @ macscripter.net .]