Sgarc
Aug 23, 2008, 01:49 PM
I use Vi a lot having to open the terminal --> Vi "Desktop/newfile.txt." got old fast. So I wrote this script
tell application "Terminal"
try
do script "vi Desktop/new.txt"
on error
display dialog "Try Again"
end try
end tell
works great. Well having to end the terminal session when I am done with Vi is well "old."
I am trying to write a script that will read keystrokes that when I enter ":q!" to end Vi will end the terminal session as well
so far no luck here is what I have so far.
tell application "Terminal"
try
do script "vi Desktop/new.txt"
on error
display dialog "Try Again"
end try
set input to keystroke
repeat until input = ":q!"
set input to keystroke
end repeat
quit "Terminal"
end tell
any ideas?
tell application "Terminal"
try
do script "vi Desktop/new.txt"
on error
display dialog "Try Again"
end try
end tell
works great. Well having to end the terminal session when I am done with Vi is well "old."
I am trying to write a script that will read keystrokes that when I enter ":q!" to end Vi will end the terminal session as well
so far no luck here is what I have so far.
tell application "Terminal"
try
do script "vi Desktop/new.txt"
on error
display dialog "Try Again"
end try
set input to keystroke
repeat until input = ":q!"
set input to keystroke
end repeat
quit "Terminal"
end tell
any ideas?
