phyllisstein Posted January 27, 2013 Posted January 27, 2013 (edited) 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. Edited May 12, 2013 by phyllisstein palobo 1
phyllisstein Posted January 27, 2013 Author Posted January 27, 2013 If this was stuck on "Working..." previously, I recommend giving the new link a shot. There was an error importing some useful libraries that I've since fixed.
palobo Posted January 27, 2013 Posted January 27, 2013 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
phyllisstein Posted January 27, 2013 Author Posted January 27, 2013 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: palobo 1
palobo Posted January 27, 2013 Posted January 27, 2013 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.
palobo Posted January 27, 2013 Posted January 27, 2013 Also, may have found a bug mate. Summon Alfred, type touch test.txt then tab. It expands to the workflows bundle id.
phyllisstein Posted January 27, 2013 Author Posted January 27, 2013 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.
phyllisstein Posted January 27, 2013 Author Posted January 27, 2013 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.
palobo Posted January 27, 2013 Posted January 27, 2013 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
phyllisstein Posted January 28, 2013 Author Posted January 28, 2013 The link is not working anymore. Whoops! I deleted the wrong version from Droplr. Should be working now.
norman.posselt Posted January 29, 2013 Posted January 29, 2013 Great workflow! After changing keyword to “new” I’m ready to go. Thanks.
Carlos-Sz Posted January 30, 2013 Posted January 30, 2013 That’s a nice workflow. Suggestion: - if the user does not type a file extension make it .txt Thanks!
phyllisstein Posted January 31, 2013 Author Posted January 31, 2013 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.
Carlos-Sz Posted January 31, 2013 Posted January 31, 2013 Great! At least one vote for a default extension.
CarlosNZ Posted January 31, 2013 Posted January 31, 2013 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?
phyllisstein Posted January 31, 2013 Author Posted January 31, 2013 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.
Carlos-Sz Posted January 31, 2013 Posted January 31, 2013 Thank you. That should be a forum rule: two votes and now you have to change your workflow!
phyllisstein Posted January 31, 2013 Author Posted January 31, 2013 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.
nitingoyal Posted March 5, 2013 Posted March 5, 2013 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
phyllisstein Posted March 14, 2013 Author Posted March 14, 2013 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.
nitingoyal Posted March 15, 2013 Posted March 15, 2013 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 not working
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now