Jump to content

[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
Link to comment

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

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

Link to comment

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.

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

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

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

Link to comment
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?

Link to comment

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.

Link to comment
  • 1 month later...

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

Link to comment
  • 2 weeks later...

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.

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