MAC

How to create a text file in a folder on a Mac


If you come to the Mac from the Windows world, you may be wondering how you can quickly create a text file in a folder in MacOS. In Windows, you can simply right-click and choose to create a new text file in any directory you are in, so how can you do something similar on a Mac?

It turns out that there are many ways to create a new text file in a folder on a Mac, so let’s look at a few different approaches.

Create a new text file in a folder on your Mac using Automator

Automator is a powerful application that allows you to script and automate things. In this case, we will create an automatic quick action that can be run from anywhere in the Finder to create a new text file at the current location of the folder. So, with a little tweaking, you’ll have a super handy easy access option to create a new text file, anywhere, anytime.

  1. Open the Automator app on your Mac and choose to create a new “Quick Actions”
  2. Take quick action in Automator

  3. Use the search function to search for “AppleScript” and double-click or drag and drop the Run AppleScript action to the workflow on the right, then add the following AppleScript text:
  4. tell application "Finder" to make new file at (the target of the front window) as alias
    Create a new text file workflow for Finder in Mac Automator

  5. Save a Quick Action with an obvious name, such as “Create New Text File”
  6. Now go to Finder on Mac and go to the folder or directory where you want to create a new text file, and drag down the “Finder” menu and go to “Services” and then select “Create New Text File”
  7. Create a new text file in the current folder on your Mac

  8. A new blank text file will be created named ‘untitled’
  9. New text file created in folder on Mac

You can use this quick action anywhere in the Finder to instantly generate a new text file.

This is probably the closest Mac action to the Windows feature by right-clicking on ‘Create New Text File’.

Create a new text file in any folder on your Mac using TextEdit

The TextEdit app on a Mac is basically like WordPad in Windows and with it you can create new text documents or rich text documents wherever you want.

  1. Open TextEdit on Mac
  2. Use your new text file or go to the File menu and select New to create a new text file
  3. Save the TextEdit document by going to File> Save
  4. Select the path of the folder where you want to save the new text document

This is how saving files on a Mac generally works, so there is nothing particularly magical or special about this approach to saving a TextEdit text file to a desired folder on a Mac.

Create a new text file anywhere on your Mac using a terminal

Finally, another method you can use to create a new text file in any location is the Terminal application:

  1. Open the Terminal on Mac app
  2. Use the following command to create a new text file in the desired location:
  3. touch text.txt

  4. For example, to create a new text file on a Mac desktop, you can use the following command:
  5. touch ~/Desktop/text.txt

The terminal is considered a bit more advanced, but the touch command is simple and can be used to route anywhere in the file system to create a new blank text file.

How did these methods work for you? Do you have a different approach to creating new text files in specific locations on your Mac? Which method do you use? Let us know your thoughts and experiences in the comments.





Source link

Naveen Kumar

Friendly communicator. Music maven. Explorer. Pop culture trailblazer. Social media practitioner.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button