Having just moved from Windows to Mac, there was one feature I was missing. The capability to create a New File as easily as one mouse click. Although a few options already exist for Mac OSX, none worked the way I wanted. Before we look at my solution to creating a New File on Mac OSX 10.6, I would like to go over some of the ones I tried.
If you are still using Mac OSX 1.5.x NuFile is a really good option, unfortunately it doesn’t work on OSX 10.6.
NuFile(pronounced new-file (Nu is a greek letter)) is a contextual menu plugin. It adds a new file menu when you right click at a folder(ie: desktop or Finder background); just like what you can do in Windows. With this menu, you can create an empty file of your favourite type with just two clicks.
Features:
Add the "New File" to the contextual menu. Drag and Drop your own templates at the preference pane to add you custom template. Open the file right after the creation(on by default. turn it off at the preference pane). And the program that will be used to open the new file is the same as the default program of the original template. Edit your templates from the preference pane Show templates' icons at the menu
You can download the must recent version in the link below.
http://www.growlichat.com/NuFile.php
Another options I tried is QuickFiles and this one works on Mac OSX 10.6.
QuickFiles is a free and simple to use OSX 10.6 AppleScript service plugin that lets you create new files of any kind in the Finder with a keystroke. Install QuickFiles then place files or folders that you'd like to use as templates into the "QuickFiles Templates" folder. When you run QuickFiles, simply select a template from the list, and it will be copied into your current folder.
QuickFiles also supports multi-select, so you can create two or more files in one operation. Just hold Command or Shift to select multiple templates from the list.
Best of all, everything can be controlled via the keyboard by binding a shortcut to the service (I used Command-Control-N). Hit the keyboard shortcut, type the first letter or two of the template you want, then hit enter to copy it into your current folder. The new file is selected for you, so you can immediately hit Enter to rename it, or Cmd-O to open it for editing.
Features:
- Create a new blank text document
- Create a new class file, FLA, or xml file from a template file
- Create a copy of a sales letter or contract that you personalize often
- Create a new project folder with all of its sub folders and starting files already in place
- Create an alias to a file or folder that you use regularly
- Copy frequently used code libraries (including package directories) into your project
You can download the latest version by fallowing this link
http://www.gskinner.com/blog/archives/2010/02/create_new_file.html
I tried QuickFiles but it wasn’t exactly what I was looking for, besides I wasn’t ready to learn another way of creating files. I was looking for something as simple as creating a new folder, which can done with one click of a mouse, if you have New Folder shortcut on the Finder Toolbar.
After a few search on Google, I turned to Mac OSX built in scripting language called AppleScript. With the help of some examples from a few sites, I a put together a script that does exactly what I wanted.
Features:
- Finder toolbar shortcut/alias
- create any type of file
- provides a list of files to choose from
- detects if file already exists
The code below is what you will need to create your own Applescript.
try
tell application "Finder" to set the this_folder
to (folder of the front window) as alias
on error -- no open folder windows
set the this_folder
to path to desktop folder as alias
end try
try
tell application "Finder" to set the source_folder to (folder "Documents:Templates") of home
set file_list to name of every file of source_folder
set selectFile to (choose from list file_list with prompt "Pick the file you want to create.")
set from_folder to source_folder as alias
set myfile to from_folder & selectFile as text
on error -- template folder has not been create
display dialog "Template Folder does not exit. Visit www.liciniosoares.com for help."
quit me
end try
try
tell application "Finder"
duplicate myfile to this_folder
end tell
on error errMsg number errNum -- warn user that a file with the same name already exists
if errNum = -15267 then
display dialog errMsg
else
quit me
end if
end try
I am also going to make available a downloadable version which you can start using right away. Come back soon to download this utility.
On the internet, saying you'll do something and then not doing it is all too common.
As is having no date at the top of a forum or one as useful as '30 Aug'.
I understand your frustration and appreciate your comments. I clearly see your point about the date will change it to reflect the year. I encourage everyone to post your comments and criticisms about anything you see here, this will help and motivate me to keep on tops of things.
Thank you to everyone who has taken two seconds out of their life to post your comments.
I really wanted this to work :(
Every time I run the script, it tells me that the template folder does not exists.
You mentioned having a downloadable version for this, which could be really amazing, as I don't like messing around with the ScriptEditor too much.