Create New Text File in macOS Finder

In my previous post, I talked about how annoying it is to create a new file in a folder in Finder on macOS. In this post, I’ll show you how to create a further Finder action to make creating new files easier.

New Text File in MacOS context menu

I find it annoying to create a new file in a folder in Finder on macOS because I’m used to a different workflow on Linux and Windows. On those platforms, I can right-click (or use a keyboard shortcut) to create a new file, then name it and open it directly. But on macOS, the process is the reverse; I have to open the corresponding app first, create a new file, and then save it to the folder I want. This is more complicated and risky if I accidentally close the app or lose my internet connection.

How macOS prompts me to create a new file can be cumbersome and reduce task efficiency. That’s why I looked for a way to add an option to the context menu to create a new file.

When using Finder on macOS, I miss and wish for a simple, powerful, and customizable file manager like Thunar on Linux, especially with the Custom Actions feature. Finder has a similar feature called Quick Actions, but when using Automator, it seems quite complex with many advanced options. 🤦🏻‍♂️

Create the “New Text File” custom option in Quick Actions using Automator.

To create a “New Text File” option in Finder, you can follow these steps:

Create New Text File in macOS Finder 1

To create a “New Text File” option in Finder, you can follow these steps:

After opening Automator, select “Quick Action.” According to the description, your additional feature will be added to Finder, Touch Bar, the Services menu, and Quick Actions that can be managed in System Preferences.

Create New Text File in macOS Finder 2

In the left library section, locate Run AppleScript, and double-click it to add it to the Workflow.

Create New Text File in macOS Finder 3

Before creating an AppleScript, you declare its properties as shown above so that it appears in the folder where you want to create a new file in Finder (first line). Then enter the following AppleScript:

-- Copyright (c) 2023 Nguyen Dinh Quan @ narga.net
-- AppleScript to create a new file in Finder

tell application "Finder"
	set fname to "untitled.txt"
	set i to 0
	repeat while i < 999
		if i > 0 then
			set fname to "untitled (" & i & ").txt"
		end if
		if not (file ((target of Finder window 1 as string) & fname) exists) then
			tell application "Finder" to make new file at (the target of the front window) as alias with properties {name:fname}
			set i to 1000
			return
		end if
		set i to i + 1
	end repeat
end tell

The code above is quite simple, and it will create an empty text file named untitle.txt. If there is a file with the same name in the current folder, it will automatically add a number to the end, such as untitle 1.txt. This process creates up to 1000 new files. It’s probably enough unless you are very bored. I prefer to use a much faster command when you need to create 3 or more files.

Save it as a “New Text File.workflow” file in the location /Users/{your username}/Library/Services.

If you find creating a workflow too tricky, you can download my New Text File.workflow and put it in the above location.

That’s it. Next, if you are too lazy, don’t have time, or have too much money 🤭, you can buy some software like FastScript 3 ($39.95) 😱 – an incredible price for a 20-year-old software 🤓 to do a simple task (creating a new file is only one of its features, but it is potent and useful). New File Menu costs $1.99; of course, it adds a “Create New File” option to the Finder menu. This software has a free Lite version that only creates text files, but I didn’t use it because I only found out about it after I finished making my workflow.

Create New Text File in macOS Finder 4

iBoysoft MagicMenu also does the same thing, but they sell it for an even more incredible price. They rent the software for $49 a year. It must be overpriced 🥸

I hope you find a reasonable solution.