Jump to content
phyllisstein

[Fixed] Create a new file in the Finder

Recommended Posts

Now downloadable at this link and via AlfPT, a workflow for creating a file in the frontmost Finder window. Simply enter "touch" followed by a filename to create a file. Select "Add Filename" to save a filename for later quick access through Alfred's feedback system, and "Add Path" to store a path that can then be used, through the feedback system, to save a file directly to that folder; just type "touch filename at" to see the list of stored paths. You can also delete files by entering their names and pressing Control+Return, or forget saved paths and filenames by entering them back into the "Add" prompts and pressing Control+Return. Pressing Command+Return will open a new file after it's created.

 

touch_screen.png

Edited by phyllisstein

Share this post


Link to post

Feature suggestion, something I had in one of my v1 extensions:

 

Default locations for files when there is no finder window. That way you could easily create a new note and open it in your editor of choice, or create a new opml in an outlines folder etc. That still comes in handy so often for me :)

Share this post


Link to post
Feature suggestion, something I had in one of my v1 extensions:

 

Default locations for files when there is no finder window. That way you could easily create a new note and open it in your editor of choice, or create a new opml in an outlines folder etc. That still comes in handy so often for me :)

 

Check out the new version and see if that's what you had in mind:

Screen%20Shot.png

Screen%20Shot%202.png

Share this post


Link to post

Nice... Almost perfect. So while I'm the feature request bandwagon here goes a few more suggestions. Implement only if you see fit of course ;)

 

  • Feedback, via growl so we now a path or filename was saved for future use;
  • Feedback so we know a file was created, useful if you're not at the frontmost finder window
  • Modifier to optionally open the file after creating it. This is an excellent alternative to scratch file or even nvALT, a thought pops into your mind, "touch cool-idea.txt at ..." then Byword or whatever opens for editing ;)
  • Some way to remove stored paths/filenames.

Other than that, awesome, yet another great workflow for my collection.

Share this post


Link to post
Nice... Almost perfect. So while I'm the feature request bandwagon here goes a few more suggestions. Implement only if you see fit of course ;)

 

  • Feedback, via growl so we now a path or filename was saved for future use;
  • Feedback so we know a file was created, useful if you're not at the frontmost finder window
  • Modifier to optionally open the file after creating it. This is an excellent alternative to scratch file or even nvALT, a thought pops into your mind, "touch cool-idea.txt at ..." then Byword or whatever opens for editing ;)
  • Some way to remove stored paths/filenames.

Other than that, awesome, yet another great workflow for my collection.

 

Your wish is my etc. See the updated link in the first post. The modifier Ctrl will delete stored files and paths, the modifier Cmd will open the file after it's created or the folder after it's saved.

 

I added some Notification Center feedback, but mostly only if the results of the action wouldn't be immediately obvious. I'm generally sort of reluctant to be constantly shouting at the user. But if more feedback winds up in demand, I'll add it.

Share this post


Link to post
Also, may have found a bug mate.

 

Summon Alfred, type touch test.txt then tab. It expands to the workflows bundle id.

 

Ah, minor laziness: a legacy from not updating it to use PyAl properly. It'll autocomplete back to touch now, just because I'm not really sure what the expected behavior would be otherwise.

Share this post


Link to post

You sir are on fire! Very nice, and PyAl is shaping up very nicely. Once I get some free time I'll update my workflows to use PyAl!

 

Cheers,

PL

Share this post


Link to post
That’s a nice workflow.

 

Suggestion:

 

- if the user does not type a file extension make it .txt

 

Thanks!

 

Thank you! I admit that I'm reluctant to do that, but I'll take it under advisement and if the general feeling is for the change then I'll make it. I often like my plaintext files extensionless, and it I think that makes sense on a UNIX system, but as I said, if the collective user-will makes itself felt, I'll bend.

Share this post


Link to post
Thank you! I admit that I'm reluctant to do that, but I'll take it under advisement and if the general feeling is for the change then I'll make it. I often like my plaintext files extensionless, and it I think that makes sense on a UNIX system, but as I said, if the collective user-will makes itself felt, I'll bend.

 

Great! At least one vote for a default extension. :)

Yep, count my vote for default ".txt" as well. Why don't you just set the default extension in a config file and then the user can set it to what they want?

Share this post


Link to post

Alright, I guess two votes is votes enough. It'll now default to .txt., but this can be changed by setting "extension" in "~/Library/Application Support/Alfred 2/Workflow Data/com.danielsh.alfred.touch/com.danielsh.alfred.touch.settings.json".

 

Edit: New link above, also updated in AlfPT.

Share this post


Link to post
Thank you. That should be a forum rule: two votes and now you have to change your workflow! :)

 

Hah! I figure demands for changes are like cockroaches—for every one, there's a thousand more lurking under the floorboards. ;)

Share this post


Link to post

Saved path is not showing up for me. After saving the path, if I hit Alfred with "Touch new.txt at" it does not show the saved path, instead, it goes to the default fallback search of Alfred. It is working fine with the stored Filenames via "Touch add".

 

edit: I am on 2.0(150) and 10.8.2

Share this post


Link to post

Saved path is not showing up for me. After saving the path, if I hit Alfred with "Touch new.txt at" it does not show the saved path, instead, it goes to the default fallback search of Alfred. It is working fine with the stored Filenames via "Touch add".

 

edit: I am on 2.0(150) and 10.8.2

 

Sorry it took me so long to see this! I've just pushed an updated version to http://alfred.daniel.sh/Workflows/CreateNewFile.alfredworkflow. There was a misplaced parenthesis that was throwing everything off. Should be working fine now.

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...