Created
May 6, 2023 11:19
-
-
Save kytta/1424a2c42de384eb92863ec989cf1c44 to your computer and use it in GitHub Desktop.
AppleScript to open a new iTerm2 window (Raycast compatible)
This file contains hidden or 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
#!/usr/bin/osascript | |
# This is free and unencumbered software released into the public domain. | |
# SPDX-License-Identifier: Unlicense OR CC0-1.0 | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title New iTerm2 Window | |
# @raycast.mode silent | |
# Optional parameters: | |
# @raycast.icon ⌨️ | |
# @raycast.packageName Developer Utils | |
# Documentation: | |
# @raycast.description Opens a new iTerm2 window with default profile | |
# @raycast.author Nikita Karamov | |
# @raycast.authorURL https://www.kytta.dev/ | |
if application "iTerm" is not running then | |
activate application "iTerm" | |
else | |
tell application "iTerm" | |
create window with default profile | |
activate | |
end tell | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Important: Read before you use it
Do not open this script in the Script Editor! On my machine, it saved it in UTF-16 with BOM (little endian), which couldn't be recognized by
osascript
and couldn't be executed from the command line.On my machine, this script is a UTF-8 text file with rights to execute (via
chmod +x
)