5

On windows, when you right click then you have option to create files.

I want to do that too on Mac, how can I do that without terminal?

0

4 Answers 4

3

I myself Always used TextEdit for this job, open TextEdit and save blank page with desire extension in desire location.

Also you can use nufile (I didn't test myself)

enter image description here

Or use some applescript.

1
  • I wish! I don't think contextual items work in 10.6. This program didn't work for me, and I recall the Finder SVN plugin also cannot work in 10.6.
    – user588
    Apr 16, 2011 at 15:50
4

What is the intention of creating an empty file? To open it? Then why not simply open the app in the first place?

But, If you want to have a couple of files ready to get something started, you can make them, and then use Get Info on them and set the Stationary Pad option. If you then double-click such a file, the app will start with an untitled copy of that stationary file.

If you have a few of those stationaries, you can put them in a folder or in the dock for easy access.

If you want to create empty files for another purpose, let us know...

5
  • Spoken like someone who has never used the Terminal. There can be plenty of reasons to make empty files.
    – Wildcard
    Oct 24, 2016 at 23:24
  • Probably because you have the folder open in Finder. If you open the app first you have to navigate to the folder before saving. But if you create a blank file, it is placed correctly immadiately.
    – Fuzzy76
    Jun 18, 2018 at 12:17
  • @Wildcard The OP wanted to have a solution without Terminal, so I suggested a way without Terminal. If not, there are plenty of solutions (touch, echo, cat, ...). For what it's worth, I've been working with teletypes/VT100/... in RSX, VMS, Unix and other OS where windows and mice were not often associated with computers. Jun 25, 2018 at 14:09
  • @Fuzzy76 Is your comment related to my suggestion? Jun 25, 2018 at 14:10
  • @PeterFrings yes. It was an attempt to answer why you wouldn’t necessarily start your workflow by opening the app first.
    – Fuzzy76
    Jul 2, 2018 at 18:36
3

There is a workaround using Automator and Applescript. I tried it out; it works. The only shortcoming is, that you have to click on a file in the folder in order to execute the script.

How to create the service

Launching Automator and select Service. In the Automator main window at the top right, set the Service Receives Selected drop-down to `Files or Folders. Drag the following actions into the work area:

  • Run AppleScript (in the Utilities section of the library on the left panel).

Copy and paste the following script into the code box and compile the code clicking the hammer icon.

on run {input, parameters}
  tell application "Finder"
    set currentPath to insertion location as text
    set x to POSIX path of currentPath
  end tell
  return x
end run

Below that block, insert a new object Set Value of a Variable (in the Utilities section). Click the Variable drop-down and create a new variable calling it CurrentFolder.

Then, add a New Text File action (from the Text section of the Actions library). Drag the variable you just created (CurrentFolder) from the Variable panel at the bottom of the Automator window to the Where section of the New Text File action.

Click the New Text File's Options button and select Show This Action When the Workflow Runs. This will allow you to specify the name of new files.

Save the service and give it a name (e.g. Create New File).

Try it out in Finder going to the folder where you want to create a new file. Control-click on an existing file within that folder and select Create New File from the Services submenu. A dialog appears asking for a filename. Insert a name with file extension and click Continue. The new file should be there.

Here is a screenshot of the Automator job (sorry my Mac is German, but I guess you'll understand): Mac Automator New File Script

0
2

This is probably a bit out of scope, but with Quicksliver you can create new text files quite easy.

Open Quicksilver with the keyboard shortcut, press period ., type some text (or not), switch to the actions and select "Create file...".

And Quicksilver is a very handy tool in general.

1
  • Or with Alfred, or with BetterTouchTool.
    – Wildcard
    Oct 24, 2016 at 23:24

Not the answer you're looking for? Browse other questions tagged .