Skip to content

Instantly share code, notes, and snippets.

@robsonke
Last active August 29, 2015 14:16
Show Gist options
  • Save robsonke/e0dda2b313d013563290 to your computer and use it in GitHub Desktop.
Save robsonke/e0dda2b313d013563290 to your computer and use it in GitHub Desktop.
on alfred_script(q)
tell application "iTerm"
activate
tell the first terminal
launch session "Default"
tell the last session
-- give the iterm tab the name of the process
set name to q
-- take the tomcat based on keyword parameter
-- useful in case you want to use multiple tomcats
if ((q as string) is equal to "something")
write text "cd ~/tomcat/bin"
end if
write text "./startup.sh"
end tell
end tell
end tell
tell application "System Events"
set visible of process "iTerm" to true
end tell
end alfred_script
@robsonke
Copy link
Author

How:

  1. Create new workflow in Alfred
  2. Use the template "Keyword to applescript"
  3. Use above script and change the paths

Usage:

Alfred: yourkeyword something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment