Create New Text File In Folder for Mac
For those interested, here’s the AppleScript (in convenient ZIP format…) for creating a new TXT file in the currently selected Finder window’s location. It will launch TextEdit if not already open, and the tricky part: see if it just launched, was already running but had no documents open, or was running and has documents open. It will then prompt you for a filename (I know, not 100% Windows-equivalent, but it’s better than having “Untitled 24.txt” in your folder). If you cancel, nothing happens, so yay. If you click OK, you’ll get a new window in TextEdit (or TextEdit will launch and NOT give you two new documents for the price of one… that was a pain to figure out), and a saved file with your chosen name in the Finder window.
One difficulty seems to be that it continually prompts you if you want to run the script when you select it from the Scripts menu, and I have NO idea how to get that to go away :P.
If anybody can turn this into a Contextual Menu Item or an Automator action, that’d be awesome. Heck, even just removing the “Run this script?” prompt would be fantastic.
December 16th, 2007 at 5:24 pm
Thanks! As an old Windows user I have been searching for a way to do this for a long time now. If you or anyone else that reads this post can recommend a website that has more useful applescripts like this one, please email me a link to it at tragicmike -at- yahoo -dot- com.
Mike