Here’s what turns out to be the most intractable problem I’ve encountered in my move to OSX as my primary work platform:
For years I used a programmers’ text editor tool in Windows called Ultraedit. It worked great and allowed me to record macros. The most indispensible one, which I used constantly, was for automating the creation of HTML links. I would store the link-to URL in a clipboard, select some link text and start the macro. The macro would magically surround the link text with the proper HTML code to link it to the URL in the clipboard.
I achieved this by
(a) copying the link text to a second clipboard;
(b) typing the <a href=”
(c) pasting in the URL from the first clipboard;
(d) closing the tag with “>
(e) pasting the link text from clipboard #2;
(f) ending the link with </a>
It sounds kinda complicated but it worked beautifully, and Ultraedit’s macro recorder simply “got it.” I created the macro years ago, and its keyboard shortcut became hardwired in my memory.
Now I’m using TextWrangler and, alas, AppleScript doesn’t seem to get it at all. The AppleScript recorder seems to grab the actions at too specific a level — i.e., it doesn’t capture “switch to next clipboard” but records the specific clipboard number; it doesn’t capture “current active document” but records the specific document name that I happen to be using while I’m recording the script.
I was gearing myself up to learn enough AppleScript to try to write the script (or edit a recorded script well enough to make it work). Then I discovered that, perhaps thanks to Snow Leopard upgrade, the entire AppleScript recorder in TextWrangler doesn’t seem to work at all. When I record a script and try to save it I get the following error message: (MacOS Error code: -4960). As far as I can tell, I can’t save any scripts at all, making any AppleScript solution to this problem seem hopeless.
I know, I know, if I had learned emacs years ago I wouldn’t have any of these problems. But I didn’t. I welcome any tips/suggestions! Is there a text-editor for Mac that will make my life easier? (I used to use the full version of BBEdit, and, back in those days, it wasn’t any easier to script than Textwrangler.) Is there some obvious solution I’m missing?