Last active
August 29, 2015 14:03
-
-
Save garrettreid/591d0df5a97f24deeffc to your computer and use it in GitHub Desktop.
Drag and drop VIM editing
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated script to correctly handle pathnames with spaces (by encoding path with ""s)