There have been a few occasions when I envied Windows users' ability to create a new empty file within explorer by simply right clicking. Why can't we do this in the Finder on Mac OSX?
Browsing the forums on MacNN, I encountered this post on the issue, which spurred me to apply my limited AppleScript knowledge (mainly gained while trying to create my flCompile workflow) to create a solution. The result is the "Quick File" Automator workflow (aka context menu extension), which takes it one step better than Windows by letting you define template files.
To use Quick File, simply open the folder that you wish to copy a template into. Right click in the finder window (or on a file in the window), and select "Quick File" from the "Automator" menu. Select the template you wish to copy using the mouse or keyboard (arrow keys, or type the first few letters of its name), and click ok (or press enter). The template will be copied into the folder and selected. Hit enter to rename the file, or cmd-O to open it.
The list of file templates is controlled by placing template files in a "Quick Files" folder in your Library. Read the Read Me for full information.
Disclaimer
I take absolutely no responsibility for any problems you experience or damages (direct or indirect, including but not limited to loss of data) caused by using these workflows. I have tried my best to make sure they are totally safe, but I am not an AppleScript expert or a command line guru. Use at your own risk.
You can download this handy extension by clicking here. Be sure to read the supplied Read Me for installation and usage instructions.
Comments (8)
Hi,
Posted by: John Barrett at March 13, 2006 01:54 AMTHANK TOU SO MUCH!
This is so wonderful, I don't know how to thank you. I wish I knew actionscript, but I am just getting started. This workflow you came up is so useful,and I would really like to thank you for taking the time to create it, and as well as sharing it.
Thanks,
John
URL: http://www.johnbarrett.net/blog/
There is also this: http://www.growlichat.com/NuFile.php
Posted by: Aaron at March 13, 2006 10:06 AMURL:
Someone did it before ;)
Posted by: freddy at March 13, 2006 10:06 AMhttp://www.growlichat.com/NuFile.php
URL:
Yes, I'm aware of NuFile. This was largely an exercise in AppleScript. Still, it has benefits over NuFile such as managing a longer list of templates more effectively, and allowing you to navigate the list with the keyboard (selecting by typing the first few characters is especially handy for me). Conversely, some people will find NuFile's submenu more useful. Options are always a good thing imho (especially free options).
Posted by: Grant Skinner at March 13, 2006 11:20 AMURL: http://gskinner.com/
Keep up good job :). Yep, more choices is better for everyone.
Posted by: Tee at March 13, 2006 09:02 PMURL: http://www.growlichat.com/NuFile.php
Hey, nice job but you forgot the case where there are no finder windows open (sometimes you just want a quick file to the desktop... Here's the change for your AppleScript:
tell application "Finder"
try
set filePath to (folder of the front window as string)
on error what
set filePath to (path to desktop folder as string)
end try
end tell
set fileDir to getDirectory(filePath)
Thanks again for the cool workflow.
Posted by: Seth at March 14, 2006 01:25 AMURL:
My God!
Good job!
thanks a lot! Now I can create my class files more easily...
thanks!
Posted by: Alain at March 21, 2006 07:51 PMURL: http://www.coefficient.ca/
I like your solution very much, but I have to second NuFile too
Posted by: Juan Frias at April 6, 2006 08:27 PMURL: http://www.corvidwebsolutions.com/