Jump to content

Create New Folder Current Finder Window


Recommended Posts

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 by Migs
additional PS
Link to post

Quick and dirty, but should work fine: Download.

 

For anyone trying to replicate after the link dies:

xRM3W04.png

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

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 post

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

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