Jump to content

New Path — Make new files and folders in the current Finder location


Recommended Posts

Call nf followed by a file name (if no extension is given, .txt will be used) to make a new file. Calling nfo instead will open the files after creation.


nd and ndo behave similarly, but for directories. Two important diferences: no extension is added, and subdirectories can be created with /.


If a Finder or Path Finder window is the frontmost window, the new paths will be created there, otherwise they will be created on the Desktop. Use | to separate the names of multiple entries (surrounding spaces will be trimmed).


cDBBQG3.png
qAXwk5d.png

 

Download | Source

Link to comment
  • 2 months later...
  • 1 month later...
  • 6 months later...
  • 10 months later...
  • 6 months later...

Hi. Thanks for the workflow.

Sounds like this workflow now supports more than just .txt - I wondered what they were?
(the link you gave above, to the other Workflow that supported .rtf is now dead so hoping it should support that)

 

I'm on a Mac - High Sierra & it seems I can only create .txt files. Each file appears to be created but I get an error when trying to open them (below are a list of those errors). I wasn't really expecting .pages files to be included, but I pages usually has no problem opening up .doc files.

 

RTF - The document “ddd.rtf” could not be opened.  
DOC - “bbb.doc” can’t be opened right now. (Pages couldn't read the file)

PAGES - “ccc.pages” is damaged and can’t be opened.

 

Hope this is helpful.

Edited by nwebb
typo
Link to comment
12 minutes ago, nwebb said:

I'm on a Mac - High Sierra & it seems I can only create .txt files.

 

Yes, that's right. I think you've misunderstood how the workflow/files work.

 

All the workflow does is create an entirely empty (i.e. 0 bytes) file with the given name. That's a perfectly valid plain text file (or Markdown or CSV).

 

But a completely empty file is not a valid Word or Pages document. (Both of those are actually zip files, not text.)

 

RTF files are theoretically text files, but like HTML files, they are not valid if completely empty. Certain content is required.

Link to comment

Hi deanishe, really appreciate the reply!
Great explanation. Just have a few related questions if that's okay?

1. Above, Katie said she was able to create .doc and .docx files  - from what you've said I'm guessing she was mistaken & probably, like me, she had created something that wasn't really a valid file?
 

2. So the options for your Workflow are .txt or .csv (anything else?)

3. There was the other extension you linked to a while ago - it claimed to allowed the creation of .rtf files in the same way as you allow creation of .txt files - and I'm wondering if it's been removed because it didn't work, or whether the creator was using  a workaround of sorts? If it's the latter, any plans to add it in? Creating .rtf on the fly is actually all I was looking for - but at least now, thanks to your explanation  I understand why it hasn't been easy to find such a workflow :)

 

Link to comment
5 minutes ago, nwebb said:

Above, Katie said she was able to create .doc and .docx files

 

Word will open a 0-byte .docx file, even thought it's not a real Word document. Pages won't.

 

5 minutes ago, nwebb said:

So the options for your Workflow are .txt or .csv (anything else?)

 

It's not my workflow. In theory, you can create any type of file that is allowed to be 0 bytes.

Edited by deanishe
Link to comment
Quote

It's not my workflow.

Doh! Ha ha, sorry, mind is half on something else! I made the assumption and didn't even check :)

 

Quote

Word will open a 0-byte .docx file, even thought it's not a real Word document. Pages won't.

Ah, useful to know

 

Thanks for the help!

 

Link to comment
3 hours ago, nwebb said:

and I'm wondering if it's been removed because it didn't work

 

The creator of that Workflows seems to no longer be active on GitHub, where they were hosting it. I doubt the removal had to do with the Workflow itself.

 

3 hours ago, nwebb said:

or whether the creator was using  a workaround of sorts?

 

If I recall correctly, they had a blank file for each file type bundled with the Workflow, then just copied them over.

 

3 hours ago, nwebb said:

If it's the latter, any plans to add it in?

 

Not as of now. I’d consider it if there were more demand for it.

 

4 hours ago, nwebb said:

Creating .rtf on the fly is actually all I was looking for

 

Here’s a modified Workflow that does just that.

Link to comment
  • 2 months later...
14 hours ago, shmulvad said:

This workflow seems to not work for me anymore.

 

What does that exactly mean? You’ll need to provide further details for me to be able to help. Does it only work sometimes? Does it never work? Does it do something different than expected?

  • Open the debugger, set the log output to “All Information”, do the action and post the output.

  • What’s your exact Alfred version?

  • What’s your exact macOS version?

Edited by vitor
Link to comment
1 hour ago, vitor said:

 

What does that exactly mean? You’ll need to provide further details for me to be able to help. Does it only work sometimes? Does it never work? Does it do something different than expected?

  • Open the debugger, set the log output to “All Information”, do the action and post the output.

  • What’s your exact Alfred version?

  •  

    What’s your exact macOS version?

 

After first reinstalling the workflow and then restarting my Mac it now works again. I am (and was) using macOS 10.14.1 and Alfred v. 3.7.

Sorry for not trying this out before commenting.

Link to comment
  • 8 months later...
  • 2 months later...
  • 4 months later...
23 minutes ago, mjp said:

I noticed that this workflow does not create new files when the path contains a directory name containing a hash (#) sign.

 

Nice catch. That’s fixed in the latest version (same URL).

 

Welcome to the forums.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...