I'm trying to create an AppleScript app so that when I add it to Xcode > Preferences > File Types, it opens the file in Vim, inside of iTerm (I chose iTerm over Terminal because of the looks and I like the tabs).
So far I have made a droplet, so that when I drop files onto it, it opens what was dropped, inside of Vim in iTerm. And when I set it up so that files in Xcode open up with this Application, it just pops up in the Dock for a slit second then disappears.
Here is the Script...
Any ideas?
So far I have made a droplet, so that when I drop files onto it, it opens what was dropped, inside of Vim in iTerm. And when I set it up so that files in Xcode open up with this Application, it just pops up in the Dock for a slit second then disappears.
Here is the Script...
Code:
on open vFile
copy (POSIX path of (vFile as alias)) to vimPath
set vimCommand to "vim '" & vimPath & "'"
tell application "iTerm"
activate
make new terminal
tell the first terminal
launch session "Vim"
tell the last session
set name to "Vim - " & vimPath
write text vimCommand
end tell
end tell
end tell
end open
Any ideas?