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.

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:

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.

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

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
on run {input, parameters}
-- Get the path of the selected folder
set targetFolder to first item of input
-- Display a dialog box for the user to enter the file name
set fileName to text returned of (display dialog "Enter file name:" default answer "untitled.txt")
-- If the user enters nothing or clicks Cancel, then exit
if fileName is "" then return
-- Get the POSIX path of the folder
set posixPath to POSIX path of targetFolder
-- Create the full path to the new file
set newFilePath to posixPath & fileName
try
-- Use the shell 'touch' command to safely create an empty file
do shell script "touch " & quoted form of newFilePath
-- Convert the text path to a file object
-- This is an important step to prevent Finder errors
set theFile to (newFilePath as POSIX file)
-- Request Finder to display and select the newly created file
tell application "Finder"
activate
reveal theFile
end tell
on error errorMessage
-- Display a message if an error occurs
display dialog "An error occurred: " & errorMessage buttons {"OK"} default button "OK"
end try
return input
end run
The AppleScript code automates the creation of an empty text file in a user-selected folder, with the default name untitled.txt
. If a file with the same name already exists, the script automatically appends a number to the filename, such as untitled 1.txt
, and can create up to 1000 uniquely named files. This should suffice for most use cases unless you need to create many files repeatedly. For creating three or more files quickly, a faster command or approach can be used to streamline the process.
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.

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.