Hi @ all,
after quite some time of fiddling around with little script (and usually miserably sucking at this) I decided to get a decent book and to study it from scratch.
One thing came to my mind after my first day:
Is there some sort of Plugin to the Editor which is basically just a shorthand tool for writing common commands.
From the Latex-GUI TeXShop I’m used to those palletes and they help hugely to increasy the typing speed as you just hit a single button and the command connected to it is inserted, as you can see on this screenshot.
One way to “achieve” that would be using text-expander, but that only works for a couple of those commands because after a while one runs out of memory to store all those shortcuts
Thanks for any idea in advance
The Script Editor doesn’t accept plug-ins, but you might achieve what you want in other ways. Typinator is much faster and more efficient than text-expander. I use it and like it. The other way to go is to use TextMate, a highly programmable text editor for which I think there’s an AppleScript plug-in, but it’s rather expensive.
In the Script editor as of Snow Leopard at least the /Library/Scripts/Script Editor Scripts/ works as a contextual menu from within Script Editor if you control click. This enables you to have scripts and snippets inserted into your code when you click on the menu item. You can also create your own hierarchy which suits your own logic and needs. It is not as fancy as a graphical palette though, but it is the closest I have gotten.
I have somthing like this:
In there there are scripts like this: this is © Sal Sohoigan & Apple Computer 1998
set the clipboard to "on extract_shortname_from(the_filepath)
set the_filepath to the_filepath as text
set x to the offset of \".\" in (the reverse of every character of the_filepath) as string
-- return ((characters -(x - 1) thru -1 of the_filepath) as text)
return ((characters 1 thru -(x + 1) of the_filepath) as text)
tell application "AppleScript Editor"
tell front document
set the selected_text to contents of selection
if the selected_text is "" then
set selected_text to the clipboard as text
set contents of selection to characters 1 through (length of selected_text) of selected_text as text
--set the selected_text to contents of selection
You could also drag out clippings of scripts and store them as such, -easy to see what they contain, but my experience is that they aren’t as flexible after all but that’s me. There is a bunch of script delivered with Script Editor which works like the one I posted, or more advanced, depending on what it does. And it works actually ok, if one sticks with it, and nurtures the three by creating menu items of often used snippets.
Here’s a third option… Butler… it’s a free clipboard manager amongst many other things. I have many clipboards saved with applescript code. So I place my cursor somewhere, choose the clipboard, and the code is pasted in for me.
Butler is great, uses it every day, great shortcut manager too -Really!.
I really wish for “intelligent clips”, which would say let me drag in an error handler , and it would then say embed the selected statements of the code into a try block from the clipping.
By the way have you tried that calculator app Soulver there is a lot of good stuff to come and to be made
Seen it both at Ars readers awards and at John Gruber’s blog.