Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Run scripts via the Script Menu via keyboard System
I work with image files and I have many scripts and Automator workflows to handle and modify them. Lots of these actions are assigned to Quicksilver keyboard shortcuts, as I hate using the trackpad. Unfortunately it's difficult (for me) to remember all the keys, and I'm also running out of keyboard! So this tip assigns a keyboard shortcut to the script icon in the menu bar, and allows you to easily select the scripts/workflows within by keyboard. It will work with most apps.

First, open AppleScript Utility in /Applications » AppleScript, and activate Show Script Menu in menu bar and Show application scripts at: top. Then, holding Command, drag the Script icon in the menu bar as far left as you can (it won't go past certain installed apps' icons).

Next, in the Keyboard Shortcuts tab of the Keyboard & Mouse System Preferences panel, enable (and change if desired) the shortcut for Move focus to status menus in the menu bar (in the Keyboard Navigation section; I used command-F2). This shortcut will now open the Scripts menu (because it's leftmost) first from within most apps.

Download Add Front App to Menu.scpt. Open the script. This creates a folder for Script Editor in ~/Library » Scripts » Applications. Then move the Add Front App to Menu script to ~/Library/Scripts. Using the menu bar script menu, you can now add a script folder for any frontmost app to ~/Library » Scripts » Applications. Let's add the Finder first. Make sure Finder is frontmost, then run that script from the Scripts menu.

Now (nearly there) copy some Finder-friendly scripts or workflows to ~/Library » Scripts » Applications » Finder, and rename them so the first character of each is unique. This way, when the menu bar script menu is open, you can highlight the right script with just one key press. If you have lots of scripts starting with the same word or letter, put a different number at the front of each filename, e.g. file-jpg.scpt and file-png.scpt become 1file-jpg.scpt and 2file-png.scpt. Now you can run any number of scripts or workflows in just three key presses -- and without having to remember lots of shortcuts. Happy button pushing!
    •    
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[11,845 views]  

Run scripts via the Script Menu via keyboard | 14 comments | Create New Account
Click here to return to the 'Run scripts via the Script Menu via keyboard' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Run scripts via the Script Menu via keyboard
Authored by: diamondsw on Fri, Mar 21 2008 at 8:55AM PDT
If you need this kind of functionality, Butler would probably be a better option. It allows customized menus to be created with key shortcuts and many other triggers.

Of course, the real solution here would be for Apple to fix the Keyboard preferences pane so we can just apply shortcuts to items on the Script menu from there...

[ Reply to This | # ]

Run scripts via the Script Menu via keyboard
Authored by: PhilHints on Fri, Mar 21 2008 at 2:40PM PDT
I do use Quicksilver for lots of shortcuts, but I like having quick access to frontmost app-relevant scripts without having to remember the key combos!
Also, I like that this method uses the system and requires no extra processes running.

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: dsjkvf on Sun, Mar 23 2008 at 1:52AM PDT
you may use Quicksilver's corresponding proxy to access any menu item.

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: PhilHints on Sun, Mar 23 2008 at 3:18AM PDT
I truly love the Quicksilver 'Current Application' proxy, and I would love it even more if you could show me how to access the script icon menu to the right of the menu bar - and not just the current application menus...

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: iJak@mac.com on Fri, Mar 21 2008 at 9:04AM PDT
I tried all three versions of this hint on Safari Version 3.1 (5525.13), Mac OS X 10.5.2.

I like all three, and will use one, or another whenever I need, depending on which comes to mind first. ;-)

---
50% of all the people on this planet are below average in I.Q., even Americans.

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: deef on Fri, Mar 21 2008 at 9:28AM PDT
I don't get why the Applescript is needed. Couldn't one accomplish the same thing by manually creating the folder and enabling the keyboard shortcut in prefs.?

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: deef on Fri, Mar 21 2008 at 9:29AM PDT
I don't get why the Applescript is needed. Couldn't one accomplish the same thing by making the changes in Applescript Utilty, manually creating the folder and enabling the keyboard shortcut in prefs.?

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: PhilHints on Fri, Mar 21 2008 at 3:36PM PDT
Thanks deef, this works! But you have to add a script to the folder for it to show up in the script menu.

The good thing about the 'Add Front App to Menu.scpt' is that it saves a lot of folder navigation (and typing). It also creates a script to allow quick access to the said app's new script folder. That's why I like scripts - they do the work for you. ;)


[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: deef on Sun, Mar 23 2008 at 7:54PM PDT
Oh ok....thought I was missing something in the script.

[ Reply to This | # ]
Sequential keys
Authored by: MtnBiker on Fri, Mar 21 2008 at 10:45AM PDT
iKeys allows sequential keys which can help remembering the keystrokes. For example, Control-s followed by say 1 types your signature, followed instead by a 2 types your address. This also gives you more keys.

Caveats: iKeys is payware; and it hasn't been updated for Leopard. In October, the company noted a change in developers and the need to update for Leopard--five months ago!

http://www.scriptsoftware.com/ikey/

---
Hermosa Beach, CA USA

[ Reply to This | # ]

Run scripts via the Script Menu via keyboard
Authored by: mark hunte on Sun, Mar 23 2008 at 4:07AM PDT
And For those of you who do not want to move you Applescript Menu.
You can run this script with one of the Hotkey apps

It will find the menu where ever it is so long as its in the menu bar.

 tell application "System Events"
	set t to value of attribute "AXDescription" of menu bar items of menu bar 1 of application process "SystemUIServer" as list
	set menuExtraName to "AppleScript"
	repeat with i from 1 to count of items in t
		set this_item to item i of t
		if this_item is menuExtraName then
			click menu bar item i of menu bar 1 of application process "SystemUIServer"
			exit repeat
		end if
	end repeat
end tell

---
mh

[ Reply to This | # ]

Run scripts via the Script Menu via keyboard
Authored by: soundsgoodtome on Sun, Mar 23 2008 at 6:45PM PDT
The instructions say:

"Download Add Front App to Menu.scpt. Open the script. This creates a folder for Script Editor in ~/Library » Scripts » Applications."

By "Open the script," I assume you mean to double-click it. However, when I do so, the script opens in Script Editor. Were some steps omitted?

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: PhilHints on Mon, Mar 24 2008 at 1:53AM PDT
Yes, you're right. I should have written 'open the script then run it'. The reason for opening it first is that I don't know if you can run a script straight from a Finder window (Quicksilver junkie speaking).

[ Reply to This | # ]
Run scripts via the Script Menu via keyboard
Authored by: squalene on Mon, Mar 24 2008 at 5:01PM PDT
One of the nice things about the Scripts Menu is that once you enable it, you can choose "Open Computer Scripts Folder" and then put anything you want into that folder; Apps, Docs, scripts, aliases etc., and they'll then show up in the Scripts Menu. Selecting any of these items from the menu will open it.
The Scripts Menu thus works a lot like the old system 7 Apple menu.

I find it handy for running things that, for whatever reason, are kept in odd places on the disk, or are just annoying to navigate to.
The "User" script folder works in about the same way.

[ Reply to This | # ]