Skip to content

Instantly share code, notes, and snippets.

@nazimamin
Created September 6, 2016 07:33
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 nazimamin/9b6e337781036c31ce97f4c964222290 to your computer and use it in GitHub Desktop.
Save nazimamin/9b6e337781036c31ce97f4c964222290 to your computer and use it in GitHub Desktop.
automator: Launch terminal from right click & close duplicate windows
on run {input, parameters}
tell application "Terminal"
close (every window whose name contains "PokemonGo-bot")
end tell
tell application "System Events" to tell process "Terminal"
if exists (sheet 1 of window 1) then
tell application "System Events" to click UI element "Terminate" of sheet 1 of window 1 of application process "Terminal"
end if
end tell
tell application "Terminal"
activate
do script with command "cd desktop/pokemongo-bot && python pokecli.py -af configs/auth_fizz.json -cf configs/config.json -l" & "\"" & input & "\""
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment