Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the 'Use Terminal's vi as default text editor' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Use Terminal's vi as default text editor
Authored by: tub78 on Wed, May 14 2008 at 1:46PM PDT

I found that it was necessary to add a delay of 1 second before the command: do script "vi" ... . Otherwise, the "vi" command would sometimes run in the existing tab, and not the newly created tab. For example,

	...
	tell application "System Events" to tell process ¬
		"Terminal" to keystroke "t" using command down
	delay 1
	do script "vi " & quoted form of POSIX path of inputfile ¬
		in selected tab of the front window
	...

- S.

[ Reply to This | # ]