Use Automator to create new text files in folders on Mac
Automator is a powerful application that allows you to write scripts and automate. In this case, we will create an Automator Quick Action that can be run from anywhere in the Finder to create a new text file in the current folder location. So with a little setup, you can easily access the ability to create new text files anytime, anywhere.
- Open the Automator app on your Mac and select Create a new Quick Action
- Use the search function and search for "AppleScript" and then double-click or drag and drop the Run AppleScript action into the workflow on the right and add the following AppleScript text:
tell application "Finder" to make new file at (the target of the front window) as alias
- Save the quick action with an obvious name like "Create New Text File"
- Now go to Finder on your Mac and navigate to the file where you want to create the new text file folder or directory, then pull down the Finder menu and go to Services and select Create New Text File
## A new blank text file will be created named "Untitled" -
You can Use this quick action to instantly generate a new text file from anywhere in the Finder.
This is probably the closest Mac action to the Windows right-click "Create New Text File" feature.
The above is the detailed content of How to create text files in folders on Mac. For more information, please follow other related articles on the PHP Chinese website!