In lieu of an easy way to get a note into EF when in another program, I’d like to have an applescript to tell EF to open a stationery file. (This I’d use with Butler, probably, so that a couple of keystrokes could take me to EF with a newly created rtf document open.) I prefer a stationery file because I can control its settings–background color and such.)
Since I haven’t the slightest clue about applescript, can someone give me a hand? If there’s a decent tutorial that might get me up to speed for what seems like a fairly simpl script, I’d be happy to go through it.
tell application "EagleFiler"
import stationery "File.rtf"
end tell
will make a new record in EagleFiler based on the stationery file “File.rtf”.
There are also (non-stationery) scripts for creating new files based on text entered in LaunchBar or Quicksilver. If Butler has a similar feature, the scripts could probably be adapted for it.
You could add a line that says “activate” to bring EagleFiler to the front. Currently there is no AppleScript way to select the new file.
tell application "EagleFiler"
activate
import stationery "File.rtf"
end tell
Or, I suppose, you could use GUI scripting to select the menu item for you:
tell application "EagleFiler"
activate
end tell
tell application "System Events"
tell process "EagleFiler"
tell menu bar 1
click menu item "Stationery" of menu 1 of menu item "New Record" of menu "File"
end tell
end tell
end tell
This is basically the same as assigning a keyboard shortcut to the menu item (which you can do from System Preferences) except that keyboard shortcuts only work when the application is frontmost, whereas you can invoke the script whenever you want.