JuicyAppleNews

  • Juicy Apple News
  • MAC
  • How to
  • iPad
  • IOS
  • iOS Games
  • Contact Us

Text file on Mac (macOS): how to create?

12/01/2022 by

[ad_1]

If you’ve just started using a Mac with a wealth of Windows experience behind you, then some of the familiar tricks may not be available to you. There is a lot you can do in macOS, but just in different ways. This concerns, for example, quickly creating a text file in the desired folder. And if in Windows we simply clicked on an empty space in the folder with the right mouse button and selected the option with the creation of a text file from the context menu, then how to do something similar on a Mac?

♥ ON TOPIC: The program freezes on Mac, how to force close (complete the process): 3 ways.

It turns out that there are several ways to create a new text file in a folder on Mac at once, so let’s take a look at these different tricks.

Method 1: Create a New Text File in a Folder on Mac Using Automator

This is probably the most similar Windows feature “Create a new text file with the right mouse button” action on Mac. However, to create such an option, you need to tinker a little with Automator. Just in case, note that below we provide two more methods to create a text file on a Mac.

Automator is a powerful standard macOS application that lets you create scripts and automate your work. In our case, we’ll create a Quick Action in Automator that can be run from anywhere in the Finder to create a new text file in the current folder. Thus, after a little tweaking, you will have a very convenient and easy-to-use tool for creating a new text file anywhere and anytime.

See also  DISCOUNT (499p → 15p) Alto's Adventure - an exciting "winter" platformer for iPhone, iPad, Mac and Apple TV

1. Open the Automator app on your Mac and choose to create a new “Fast action”…

Automator on Mac

How to create an empty text file on Mac

2. Drag and drop an action “Run AppleScript” into the workflow on the right side, clear any data that was there.

How to create an empty text file on Mac

3. Add the following script text:

How to create an empty text file on Mac

set file_name to "untitled"
set file_ext to ".txt"
set is_desktop to false

-- get folder path and if we are in desktop (no folder opened)
try
tell application "Finder"
set this_folder to (folder of the front Finder window) as alias
end tell
on error
-- no open folder windows
set this_folder to path to desktop folder as alias
set is_desktop to true
end try

-- get the new file name (do not override an already existing file)
tell application "System Events"
set file_list to get the name of every disk item of this_folder
end tell
set new_file to file_name & file_ext
set x to 1
repeat
if new_file is in file_list then
set new_file to file_name & " " & x & file_ext
set x to x + 1
else
exit repeat
end if
end repeat

-- create and select the new file
tell application "Finder"

activate
set the_file to make new file at folder this_folder with properties {name:new_file}
if is_desktop is false then
reveal the_file
else
select window of desktop
set selection to the_file
delay 0.1
end if
end tell

-- press enter (rename)
tell application "System Events"
tell process "Finder"
keystroke return
end tell
end tell

3. Save the quick action with a name that you understand, for example “Create text file”…

How to create an empty text file on Mac

How to create an empty text file on Mac

4. Now on your Mac, open Finder and navigate to the folder where you want to create a new text file. Open Finder, in the menu bar go to the path Finder → “Services”then select your script “Create a new text file”…

See also  Short Notes on Mac and iPad: How to Use?

How to create an empty text file on Mac

5. A new empty text file named “untitled” will be created.

How to create an empty text file on Mac

You can use this Quick Action anywhere in the Finder to instantly create a new text file in a folder.

♥ ON TOPIC: How to automatically switch the language (layout) on the keyboard in macOS or Windows.

Method 2. Create a new text file in any folder on Mac using TextEdit

TextEdit on Mac is very similar to WordPad on Windows, and with it you can create new text or rich text documents anywhere you want on the system.

1. Open the standard TextEdit application on Mac.

TextEdit app on Mac

2. Use your text file, go to the File menu and select New, or click new documentto create a new text file.

TextEdit app on Mac

3. Save the TextEdit document by choosing File → Save…

TextEdit app on Mac

4. Select the path to the folder where you want to save the new text document.

TextEdit app on Mac

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

♥ ON TOPIC: Hidden files on Mac: 3 ways to hide files and folders on macOS from strangers.

Method 3. Create a new text file anywhere on Mac using Terminal

Finally, another tool that you can use to create a new text file anywhere is the Terminal application:

1. Open the Terminal app on Mac

2. Use the following command to create a new text file in the desired location:

touch text.txt

3. For example, to create a new text file on the Mac desktop, you can use the following command:

See also  How to delete all browsing history in Safari on iPhone and Mac

touch ~/Desktop/text.txt

How to create an empty text file on Mac

The terminal is considered a very useful tool for advanced users, but it is much easier to press the menu or application buttons, as you can also select any place in the file system to create a new empty text file there.

How good are these methods for you? Or do you use other ways to create new text files in specific locations on the Mac? Tell us in the comments about your experience in solving this simple, but so urgent task.

See also:

[ad_2]

Filed Under: Uncategorized Tagged With: create, file, Mac, macOS, text

Best Deal of the Day



Categories

  • All Apple NEWS
  • casino gambling, arts and entertainment, finance, home
  • Crypto
  • How to
  • IOS
  • iOS Games
  • iPad
  • iPhone 11 Pro
  • iPhone XR
  • iPhone XS
  • MAC
  • VPN

Copyright © 2023 JuicyApplenews.com

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT