Skip to content

Instantly share code, notes, and snippets.

@ianbattersby
Created May 17, 2014 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianbattersby/1d82bcc19c404b4e857b to your computer and use it in GitHub Desktop.
Save ianbattersby/1d82bcc19c404b4e857b to your computer and use it in GitHub Desktop.
Alfred workflow examples
on alfred_script(q)
do shell script "open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app"
end alfred_script
on alfred_script(q)
if isAppRunning("iTerm") then
activate
tell application "System Events"
keystroke "O" using {command down}
end tell
tell application "iTerm"
set myterm to (make new terminal)
tell myterm
set codingsession to (launch session "Coding")
tell codingsession
end tell
end tell
activate
end tell
else
activate application "iTerm"
end if
end alfred_script
on isAppRunning(appName)
tell application "System Events" to (name of processes) contains appName
end isAppRunning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment