Skip to content

Instantly share code, notes, and snippets.

@d0nkeyBOB
Created December 2, 2013 16:22
Show Gist options
  • Save d0nkeyBOB/7752064 to your computer and use it in GitHub Desktop.
Save d0nkeyBOB/7752064 to your computer and use it in GitHub Desktop.
on run {input, parameters}
cd(input)
end run
on cd(dir)
tell application "iTerm"
activate
set miniaturized of windows to false
try
set iterm to the last terminal
on error
set iterm to (make new terminal)
end try
tell iterm
launch session "Default"
tell the last session
write text "cd " & (quoted form of POSIX path of (dir as string)) & " && clear && ls -l"
end tell
end tell
end tell
end cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment