1

I need to run an AppleScript using a keyboard shortcut. How can I do that?

I think about

  1. Save AppleScript in textual format.
  2. Use Keyboard Maestro to launch 'osascript' to run the script when the matching keyboard shortcut is called.

What do you think? Is there better way to go?

1

2 Answers 2

4

A program like Keyboard Maestro can do exactly as you said, but instead of saving the AppleScript as just regular text you can save it as a script (.scpt) and just pass the path to osascript.

A program that I've used off and on that is designed to do this specifically is Red Sweater Software's FastScripts. It's free for up to 10 keyboard shortcuts. Otherwise I've just used LaunchBar (while others would recommend other app launchers)

3
  • +1 for FastScripts, i use it daily to save HTML pages to PDFs in a predefined folder. Commented Sep 8, 2010 at 21:00
  • FastScript seems good. BTW, can it run python/ruby scripts also?
    – prosseek
    Commented Sep 8, 2010 at 21:37
  • @prosseek: Yes.
    – Chealion
    Commented Sep 8, 2010 at 21:43
2

I do it with Quicksilver to launch a script that opens a Terminal window at the same place the foremost Finder window is.

Triggers -> [+] -> HotKey, then select your script, and choose the "Execute" action.

It's probably similar to using Keyboard Maestro, and said software might be simpler. Though, I already had Quicksilver installed when I did this, so reusing it was better.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .