Jump to content
Migs

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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

 

Share this post


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.

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