C-Command Software Forum

Script to open Stationery File

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.

Thanks

A simple script like this:

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.

Thanks for your quick reply.

This works fine to make a new file in EF.
Is there a way to make the script take me to EF as well and to the new file?

What I’m after is a quick way to get to where FILE > NEW RECORD > stationery.rtf

takes me: in EF with the new file highlighted.

Again, I don’t know what’s even possible.
I appreciate your help.

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.

Yes. This last one is perfect.
Thanks much

–I hope it’s as easy for you as it seems :wink:

I’ll have a look at Launchbar.