Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drag and drop VIM editing
set fileName to (choose file with prompt "Select a file:")
set myCmd to "vim \"" & (POSIX path of fileName) & "\""
tell application "Terminal"
activate
do script myCmd
end tell
return
on open of someFiles
repeat with fileName in (someFiles)
set myCmd to "vim \"" & (POSIX path of fileName) & "\""
tell application "Terminal"
activate
do script myCmd
end tell
end repeat
end open
@garrettreid

This comment has been minimized.

Owner

garrettreid commented Aug 14, 2014

Updated script to correctly handle pathnames with spaces (by encoding path with ""s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment