Skip to content

Commit

Permalink
Script for open a iterm window with a specific profile (raycast#938)
Browse files Browse the repository at this point in the history
* Create iterm-open-profile-in-new-window.applescript

* Update  title/packageName
  • Loading branch information
sunrisewestern authored and Hyper Focus committed Aug 6, 2024
1 parent b93cdf9 commit 7104a03
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions commands/apps/iterm/iterm-open-profile-in-new-window.applescript
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

0 comments on commit 7104a03

Please sign in to comment.