0

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 2

6

The AppleScript for iTerm 2.9/3

tell application "iTerm"
    activate
    tell (create window with profile "nvim")
    end tell
end tell
4
  • @leandros is this usable for u?
    – Jeffrey04
    Nov 17, 2015 at 2:29
  • 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 does execute command.
    – Leandros
    Nov 17, 2015 at 8:38
  • 1
    Got 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/…
    – Leandros
    Nov 17, 2015 at 8:49
  • 1
    congratulations (:
    – Jeffrey04
    Nov 17, 2015 at 9:02
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.

4
  • 6
    getting this error "The variable terminal is not defined." number -2753 from "terminal" in 10.10 Yosemite (iterm2 2.9) LOLOL
    – Jeffrey04
    Nov 5, 2015 at 8:06
  • 1
    tell application "iTerm" activate create new window with profile "nvim" end tell works tho
    – Jeffrey04
    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?
    – Leandros
    Nov 16, 2015 at 13:41
  • 1
    @leandros I have posted the one I use currently for iTerm2.9/3
    – Jeffrey04
    Nov 17, 2015 at 2:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .