Create a Services-based application launcher
Aug 25, '08 07:30:00AM • Contributed by: wordsofwisedumb
Aug 25, '08 07:30:00AM • Contributed by: wordsofwisedumb
The services menu is available in every application, although the options within it are only available when copy or paste are active (depending on whether the service takes input, produces output, or both). Because this menu is nearly always accessible, it is possible to assign a shortcut to an item in it that will almost always be accessible. This method is not always available, but the upside is that there is not third party daemon always running in the background listening for keys.
In this example, the shortcut starts the screensaver, but it would be equally simple to start an application. To make this work, you'll need the donationware application ThisService, which creates a service from any script.
Open the Produces output.scpt from the AppleScript starting points that come with ThisService. The 'produces output' means the application is available without having something selected to copy. Insert the desired AppleScript code between on process() and end process, and save it (probably as a new name in a new location). In this example the whole script will look like this:
[robg adds: I haven't tested this one.]
In this example, the shortcut starts the screensaver, but it would be equally simple to start an application. To make this work, you'll need the donationware application ThisService, which creates a service from any script.
Open the Produces output.scpt from the AppleScript starting points that come with ThisService. The 'produces output' means the application is available without having something selected to copy. Insert the desired AppleScript code between on process() and end process, and save it (probably as a new name in a new location). In this example the whole script will look like this:
on process()
tell application "ScreenSaverEngine"
activate
end tell
end process
Open ThisService, name your service, pick the script you created, select 'Produces output,' and assign your shortcut. (I used F6, which would not work from ThisService, but you can assign it later through System Preferences.) Now just make sure the focus is somewhere that would accept pasting, and test your service.
[robg adds: I haven't tested this one.]
•
[6,945 views]
