Create File from Template in OSX with Right Click

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 “QuickFiles” Automator workflow (aka context menu extension), which takes it one step better than Windows by letting you define template files.

To use QuickFiles, 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 “QuickFiles” 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 “QuickFiles Templates” 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.


IMPORTANT NOTE

This version of QuickFiles does not work with OSX 10.6. I have released a vastly improved version of QuickFiles which you can read about and download here.


You can download this handy extension by clicking here. Be sure to read the supplied Read Me for installation and usage instructions.

Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

8 Comments

  1. Hi,

    THANK 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

  2. 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).

  3. Keep up good job :). Yep, more choices is better for everyone.

  4. 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.

  5. My God!

    Good job!

    thanks a lot! Now I can create my class files more easily…

    thanks!

  6. I like your solution very much, but I have to second NuFile too

Comments are closed.