Migs Posted September 28, 2017 Share Posted September 28, 2017 (edited) Friends: ((First please excuse me if this question has been asked a million times but I couldn't find the workflow try as I might)) Newbie starting to love Alfred 3. I've searched the forums and tried some workflows with no luck. How do I create a new folder in the current finder window? Most gratefully, Migs PS: New Folder.alfredworkflow doesn't do anything and has no instructions Edited September 28, 2017 by Migs additional PS Link to comment
vitor Posted September 28, 2017 Share Posted September 28, 2017 25 minutes ago, Migs said: How do I create a new folder in the current finder window? ⌘⇧N Do you want to do it with a Keyword instead? Link to comment
Migs Posted September 28, 2017 Author Share Posted September 28, 2017 yes please, and thank you! Migs Link to comment
vitor Posted September 28, 2017 Share Posted September 28, 2017 (edited) Quick and dirty, but should work fine: Download. For anyone trying to replicate after the link dies: tell application "System Events" if (name of first process whose frontmost is true) is "Finder" then tell application "Finder" to set currentDir to (folder of the front window as alias) else set currentDir to (path to desktop) end if end tell tell application "Finder" to make new folder at currentDir with properties {name:"{query}"} Edited September 28, 2017 by vitor Link to comment
Migs Posted September 28, 2017 Author Share Posted September 28, 2017 Hi Vitor The download didn't download. Tried Chrome and Safari (The link at the transfer.sh site does not download. ) I pasted your script into the advanced window trying to replicate your graphic example but it didn't do anything. (Templates>Essentials>Keyword to Script) Thanks for helping me. Migs Link to comment
Migs Posted September 28, 2017 Author Share Posted September 28, 2017 I then went to the Applescript editor and when the script is run from within the editor it does indeed create a folder, but only on the desktop. It of course doesnt work if you do nf twice because the folder already exists. Next I saved the script as an application and added that to the alfred bin bash run script but that didnt work. query="{query}" /Users/migs/Downloads/newfold.app echo -n $query Link to comment
deanishe Posted September 28, 2017 Share Posted September 28, 2017 34 minutes ago, Migs said: bin bash run script There's your problem right there. The code @vitor posted is AppleScript, not bash. In your Run Script, set Language to "/usr/bin/osascript (AS)", not "/bin/bash", and Bob's your uncle. Link to comment
vitor Posted September 28, 2017 Share Posted September 28, 2017 1 hour ago, Migs said: I then went to the Applescript editor and when the script is run from within the editor it does indeed create a folder, but only on the desktop. That’s by design. If the Finder is your frontmost app, then it creates it in it’s frontmost window. Otherwise it creates it on the Desktop. Link to comment
Migs Posted September 28, 2017 Author Share Posted September 28, 2017 You guys (gals) are awesome. Thank you so much. Migs Link to comment
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