Follow Us

We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message

How to create a new file with Mac OS X Finder

Easy shortcuts to create files

Article comments

The Finder provides some easy ways to create new folders. (Control click and select New Folder, select File -> New Folder, or press Command-Shift-N). But it doesn't provide an easy way to create new files. (The file managers in Windows and some flavors of Linux have create-new-file options in their contextual menus.) reader zsaeid figured out a workaround using Automator and Applescript:

Start by launching Automator. In the chooser that appears next, select Service. At the top of the Automator main window, set the Service Receives Selected drop-down to Files or Folders. Then drag the following actions into the work area:

Run AppleScript (in the Utilities section of the Actions library).Paste the following AppleScript into its code box, then click the hammer icon (to compile the code):

on run {input, parameters} tell application "Finder" set currentPath to insertion location as text set x to POSIX path of currentPath end tell return x end run

Below that, insert Set Value of a Variable (also in the Utilities section). Click the Variable drop-down and create a new variable. (I called mine CurrentFolder.)

Follow that with the New Text File action (from the Text section of the Actions library). Drag the variable you just created (CurrentFolder) from the Variable panel at the bottom of the Automator window to the Where section of the New Text File action. Click the New Text File's Options button and select Show This Action When the Workflow Runs. (This will allow you to specify the names of new files.)

Save the service and give it a name (Create New File or whatever else you like). To test it, in the Finder go to the folder where you want to create a new file. Control-click on an existing file within that folder and select Create New File from the Services submenu. A dialog should appear requesting a filename. Supply one then click Continue. Your new file should appear.

At least one Hints reader wondered why, exactly, you'd want to do this in the first place. Consider it a reversal of the usual Mac workflow: Instead of creating a new file within an application and, when you save it, navigating to the folder where you want to store it, you're creating the file where you want it first. You can then open the new file in whatever application you'd like. Also, note that this service is a homemade (and less versatile) version of the utilities Document Palette and NuFile.


More from Techworld

More relevant IT news


Send to a friend

Email this article to a friend or colleague:

PLEASE NOTE: Your name is used only to let the recipient know who sent the story, and in case of transmission error. Both your name and the recipient's name and address will not be used for any other purpose.

Techworld White Papers

Choose – and Choose Wisely – the Right MSP for Your SMB

End users need a technology partner that provides transparency, enables productivity, delivers...

Download Whitepaper

10 Effective Habits of Indispensable IT Departments

It’s no secret that responsibilities are growing while budgets continue to shrink. Download this...

Download Whitepaper

Gartner Magic Quadrant for Enterprise Information Archiving

Enterprise information archiving is contributing to organisational needs for e-discovery and...

Download Whitepaper

Advancing the state of virtualised backups

Dell Software’s vRanger is a veteran of the virtualisation specific backup market. It was the...

Download Whitepaper

Techworld UK - Technology - Business

Innovation, productivity, agility and profit

Watch this on demand webinar which explores IT innovation, managed print services and business agility.

Techworld Mobile Site

Access Techworld's content on the move

Get the latest news, product reviews and downloads on your mobile device with Techworld's mobile site.

Find out more...

From Wow to How : Making mobile and cloud work for you

On demand Biztech Briefing - Learn how to effectively deliver mobile work styles and cloud services together.

Watch now...

Site Map

* *