Skip to content

Instantly share code, notes, and snippets.

@totomz
Created June 13, 2017 19:35
Show Gist options
  • Save totomz/b00855bf66d3f85b04b54b5a35c17012 to your computer and use it in GitHub Desktop.
Save totomz/b00855bf66d3f85b04b54b5a35c17012 to your computer and use it in GitHub Desktop.
AppleScript to launch new windows instead of moving focus
# iTerm
```
tell application "iTerm"
set newWindow to (create window with default profile)
tell newWindow
activate
end tell
end tell
```
# Chrome
```
set myapp to "Google Chrome"
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
if appIsRunning(myapp) then
tell application "Google Chrome"
make new window
activate
end tell
else
tell application myapp
activate
end tell
end if
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment