[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.
1. Open the Automator app on your Mac and choose to create a new “Fast action”…
2. Drag and drop an action “Run AppleScript” into the workflow on the right side, clear any data that was there.
3. Add the following script text:
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”…
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”…
5. A new empty text file named “untitled” will be created.
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.
2. Use your text file, go to the File menu and select New, or click new documentto create a new text file.
3. Save the TextEdit document by choosing File → Save…
4. Select the path to the folder where you want to save the new text document.
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:
touch ~/Desktop/text.txt
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]