PDA

View Full Version : AppleScript


Lecter
04-23-2008, 09:10 AM
To start a application, then subsequently hide/activate it, use:


tell application "System Events"
if not (exists process "iTunes") then
tell application "iTunes" to activate
else
if not (visible of process "iTunes") then
tell application "iTunes" to activate
else
if frontmost of application "iTunes" then
set visible of process "iTunes" to false
else
tell application "iTunes" to activate
end if
end if
end if
end tell

Lecter
04-23-2008, 09:14 AM
Sparks (http://www.shadowlab.org/Software/spark.php) is a small, open source utility that can run AppleScripts from speedkeys.