Skip to content

ducbao414/macos-new-text-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

macos-new-text-file

Quickly create a new text file (and other file formats) in the current Finder window (Cmd+Space n).

cmd_space_n.mp4

If you're coming from Windows, you might notice macOS Finder is missing that handy "New Text File" feature.

Instead, you have to break your workflow, open TextEdit, navigate to the right folder, and create a new file.

Some apps let you create a text file from the context menu, but they either need accessibility permissions, only work on right-clicked subfolders, or you just don't trust 3rd-party apps.

This AppleScript is just a few lines of code that lets you create a new text file in the current Finder window with (Cmd+Space n).

You can trust yourself to edit, run, and export the script right on your own Mac.

Edit & Export to .app

  • Open Script Editor (installed with your macOS), go to File → New, and paste the content of New Text Document.
  • (Optional) Modify baseName and extension if needed (in the config section at the beginning of the script).
  • Go to File → Export, choose Application as the file format, and save the new New Text Document.app to Applications.

Uses

Now that you have New Text Document.app in Applications, you can run it from Spotlight by pressing Cmd+Space, then n.

Create Other File Formats

To create files in other formats, specify the templateFile path in the config section.
If templateFile is specified (i.e., not an empty string ""), the script will create a new file in the current Finder window by copying the templateFile.

Examples:

property templateFile : "/Users/yourname/Documents/My Document.docx"
property templateFile : "/Users/yourname/Documents/Sheets.xlsx"

About

Quickly create a new text file (and other file formats) in the current Finder window (Cmd+Space n)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published