I have recently created a profile that opens nvim automatically, which works fine. However, is it possible to export it to a file/app so I can open nvim straight by double-clicking/quicksilver/spotlight?
2 Answers
The AppleScript for iTerm 2.9/3
tell application "iTerm"
activate
tell (create window with profile "nvim")
end tell
end tell
-
-
That works, no I just have to figure out how to actually write commands into the console.
write text
doesn't seem to work, neither doesexecute command
.– LeandrosNov 17, 2015 at 8:38 -
1Got it working.
tell current session of current window write text "echo test;" end tell
works like a charm. Taken from the iTerm2 AppleScript test sources. github.com/gnachman/iTerm2/blob/master/sources/…– LeandrosNov 17, 2015 at 8:49 -
1
You can make an AppleScript that accomplishes this, and export that as an app.
The AppleScript [source]:
tell application "iTerm"
activate
tell (make new terminal)
launch session "Your Profile Name"
end tell
end tell
To export as app [source]:
In Applescript editor File->Save As and choose File Format as Application.
-
6getting this
error "The variable terminal is not defined." number -2753 from "terminal"
in 10.10 Yosemite (iterm2 2.9) LOLOL Nov 5, 2015 at 8:06 -
1
tell application "iTerm" activate create new window with profile "nvim" end tell
works tho Nov 5, 2015 at 8:39 -
1@Jeffrey04 That doesn't work, either. Neither are the examples from iTerm or anything else I tried. Any ideas?– LeandrosNov 16, 2015 at 13:41
-
1