Home > Apple

How to Create a New Text File in a Folder on Mac

In this guide, we will show you the steps to create a new text file in a folder on your Mac. Recently I made a switch from Windows over to the Mac ecosystem and while Apple’s OS does behold a plethora of things worthy of praise, there are a few major omissions as well. And unfortunately, most of them revolve around the ease of convenience factor.

One of them is the inability to create a new text file inside any folder. The native method that we currently have at our disposal involves saving [Ctrl+S] or dragging the file to the desired location or using the touch file.txt command. However, carrying out this task every time doesn’t qualify as the best of usage experience apart from asking for unnecessary efforts.

So what else could be done? Well, you could take the help of one of Apple’s hidden gems aka Automator to get this job done. And in this guide, we will help you with just that. So without further ado, let’s get started with the steps to create a new text file in a folder of your choice on Mac using the Automator app.

How to Create a New Text File in a Folder on Mac

Create a New Text File in a Folder on Mac

The below instructions are listed under separate sections for ease of understanding. Make sure to follow the same sequence as mentioned.

STEP 1: Create the Script

  1. Open Launchpad from the dock, go to the Other folder, and launch the Automator app.
  2. Then select Quick Action and click on the Choose button.Create a New Text File in a Folder on Mac
  3. Now select Utilities from the left menu bar and drag the Run Applescript to the right-hand side.Create a New Text File in a Folder on Mac
  4. After that, select “No Input” under Workflow Receives and select “Finder” next to In.Create a New Text File in a Folder on Mac
  5. Now replace the entire purple script with the following command:
    tell application "Finder"
    set txt to make new file at (the target of the front window) as alias with properties {name:"empty.txt"}
    select txt
    end tell
  6. Now use Command+S to bring up the Save dialog box, name it New Text File, and hit Save.Create a New Text File in a Folder on Mac

STEP 2: Test the Script

Before moving ahead, let’s first test out this service. So head over to the desired folder via Finder. Then click on the Play button next to the service to start it. A new text file named empty.txt will be created inside the folder that you had opened. This signifies that the script is working well and good.

Create a New Text File in a Folder on Mac

However, running the script every time before you create a new text file would call for a lot of effort. So let’s assign a shortcut key that would automatically start this service. In other words, let’s create a shortcut key that would a new text file in a folder on your Mac!

STEP 3: Assign a Shortcut to the Script

  1. Click on the Apple logo situated at the top left and go to System Preferences.
  2. Then go to Keyboard > Shortcut and select Services from the left menu bar.Create a New Text File in a Folder on Mac
  3. After that, scroll to the General section and you should see the New Text File service.
  4. Finally, assign it the shortcut of your choice [make sure that it doesn’t overlap with exiting shortcuts].

STEP 4: Test the Shortcut

Now let’s put our script to the test for the one final time. So open the desired folder and press the assigned shortcut key combination. A text new file named empty.txt will be created inside that folder.

Or you could another [lengthy] approach towards this. Once you are inside the desired folder, click on Finder at the top menu bar > select Services > and choose the New Text File service. This will also create a new text file.

Create a New Text File in a Folder on Mac

Creating a New Text File in a Folder on Mac: Worth the Efforts?!

That’s it. These were the steps to create a new text file in a folder on your Mac. In comparison with Windows, which just requires a single right click, you might argue that you are having to create a script and execute around 10-15 steps just to create a new text file.

While we are not denying the fact that it is quite a lengthy approach for such a miniscule task, but this is just a one-time effort. Moreover, now that you had decided to step into the Apple ecosystem, a few sacrifices will have to be made in the long run, and this is just one of them.


Share: