Jump to content
vitor

NewFile — Creates a new file in the current Finder directory

Recommended Posts

Call nf followed by a file name (if you don’t give it an extension, it’ll be .txt) to make a new file. If you type nfo instead the files will open after creation. If you have a Finder or Path Finder window as your frontmost window, the file will be created there, otherwise it will be created on your Desktop.


uUik2XO.png

 

Download | Source

Edited by vitor

Share this post


Link to post

Thank you for this workflow!

 

Is there a pre-defined list of file types that I can create? I'm wondering because I can use this with no problem for .txt and .doc/.docx files, but not for, for example, .rtf or .key files.

Share this post


Link to post

Thank you for this workflow!

 

Is there a pre-defined list of file types that I can create? I'm wondering because I can use this with no problem for .txt and .doc/.docx files, but not for, for example, .rtf or .key files.

Not currently, no, as they were not really part of the goal. I might do it in the future, but I doubt it, since there’s another workflow that already does that.

Share this post


Link to post

Update.


New icon and some code improvements.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.

Share this post


Link to post

Update.


Use JXA instead of AppleScript.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

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

Share this post


Link to post
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.

Share this post


Link to post

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 :)

 

Share this post


Link to post
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

Share this post


Link to post
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!

 

Share this post


Link to post
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.

Share this post


Link to post

This workflow seems to not work for me anymore. Maybe it happened during the update to Mojave.

 

Anyway, I was wondering if anyone knows of a nice workflow that accomplishes the same thing as this?

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post

Thanks for the workflow.

Seems to have problems with umlauts in path, e.g. creating test12.txt in /töst/ : 
/toÌst/test12.txt: No such file or directory

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...