forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script for open a iterm window with a specific profile (raycast#938)
* Create iterm-open-profile-in-new-window.applescript * Update title/packageName
- Loading branch information
1 parent
b93cdf9
commit 7104a03
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
commands/apps/iterm/iterm-open-profile-in-new-window.applescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Dependency: requires iTerm (https://iterm2.com) | ||
# Install via Homebrew: `brew install --cask iterm2` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Open profile | ||
# @raycast.packageName iTerm | ||
# @raycast.mode silent | ||
|
||
# Optional parameters: | ||
# @raycast.icon 🤖 | ||
# @raycast.argument1 { "type": "text", "placeholder": "Placeholder" } | ||
|
||
# Documentation: | ||
# @raycast.author sunrisewestern | ||
# @raycast.authorURL https://github.com/sunrisewestern | ||
|
||
on is_running(appName) | ||
tell application "System Events" to (name of processes) contains appName | ||
end is_running | ||
|
||
on run {argv} | ||
set iTermRunning to is_running("iTerm2") | ||
tell application "iTerm" | ||
activate | ||
if not (iTermRunning) then | ||
delay 0.5 | ||
close the current window | ||
end if | ||
create window with profile argv | ||
end tell | ||
end run |