Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.4: Create new blank text files via contextual menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Create new blank text files via contextual menu
Authored by: ZacharyArnold on Mar 28, '07 12:25:20PM
Here's an expanded script I wrote to mimic the new text file contextual menu behavior in Windows. Create the contextual menu as described in the original hint, but use the following for the body of the AppleScript:

on run {input, parameters}
		tell application "Finder" to set the sourceFolder to (folder of the front window) as alias
	on error
		-- no open folder windows
		set the sourceFolder to path to desktop folder as alias
	end try
	set sourceFolderPath to (POSIX path of sourceFolder) as string
	set touchScript to "touch " & sourceFolderPath & "newTextFile.txt"
	set openScript to "open " & sourceFolderPath & "newTextFile.txt"
	do shell script touchScript
	do shell script openScript
	return input
end run

[ Reply to This | # ]
10.4: Create new blank text files via contextual menu
Authored by: osxpounder on Mar 29, '07 11:50:38AM

What's nice about this hint is that I can make a text file with a right-click now, though usually I'd prefer to use keystrokes, as they are easier on my tired hands. So far I've experimented with Butler, which brings it downo to these keystrokes:

CTRL-space to bring up Butler
tex to choose TextEdit
Return to confirm

If I could have one system-wide keystroke that would:
- take whatever text is selected and put it into a new text document
- if no text is selected, simply open a new, blank text document

... that would be swell.

[ Reply to This | # ]