Focusing the script menu for keyboard input

Here’s a small but very useful trick if you’ve populated your AppleScript menu with dozens of useful doodads. Many of my scripts are more in the character of macros—quick procedures that duplicate a few manual steps so I don’t have to point-and-click in several places. The problem I had is that it briefly interrupts my workflow to mouse up to the AppleScript menu and then find the script I want hierarchically.

Picture 11.pngWith Quicksilver or another launcher utility, of course, you can assign keystrokes to whatever you like, but that raises the problem of remembering which keystroke goes to what.

So I came up with this instead. I’ve assigned the following AppleScript to be a Quicksilver trigger (using Command-F12):

tell application “System Events”

tell process “SystemUIServer”

click at {1105, 11}

end tell

end tell

 

If you’re wondering, {1105, 11} are the X/Y coordinates of my AppleScript menu. I’d be happy to tell you yours, but that depends on both the size of your monitor and where you’ve stashed the menu icon. The 11 coordinate—vertical distance from the top—is going to be the same on your Mac, at least until Leopard comes along and gives us resizable menu bars. You can find your horizontal coordinate the same way I found mine–fiddling with the X number and seeing what gets clicked on when you run the script.

So I hit Command-F12, and down comes the menu. Then I can use the keyboard to navigate; type a few letters to highlight a category, right-arrow for the script list, boom. If I’ve stashed a script in the Applications submenu (at the bottom in the picture above; these scripts live in ~/Library/Scripts/Applications/exact_app_name instead of ~/Library/Scripts/Category_name/), then I can keyboard to them directly without a submenu.

Picture 21.png

Example: I want to run that Image scaling script, so I type Command-F12, “IM”, right-arrow. Or I want to Noguchi my Desktop (more on that in a later post), so that’s Command-F12, “NO”.

On my secondary G4, I only have about a half-dozen scripts total, so this is overkill there. But if you’ve more than that installed, then give this a shot.

Leave a Reply

Your email address will not be published. Required fields are marked *