Jump to content
jmm28260

Unfold or fold all folders and subfolders in directory

Recommended Posts

Hi,

I am completely illiterate in Alfred that I discover and it seems awsome to me! Would anyone be compassionate enough to help me start a workflow that would unfold all folders in a directory ?

Any help would be much appreciated (including of course, learning material to be followed to progress by myself).

Thanks in advance.

 

JMM

Edited by jmm28260

Share this post


Link to post

What do you mean "unfold all folders in a directory"? In Finder using List View?

 

If that is what you mean, OPT+Click on the triangle does that.

 

Alternatively, you can select one or more folders and use CMD+OPT+Right Arrow to expand all folders recursively. CMD+OPT+Left Arrow collapses them again.

Edited by deanishe

Share this post


Link to post

Thank you deanishe for your answer.

My purpose would be to expand (not open) ALL folders and subfolders in the directory, and subsequently, to reduce all of them. Am I clear in my explanation ?

I know that I could click on the triangle, but I would like  a workflow to take care of the procedure for all the folders and subolders.

Share this post


Link to post
Either I don't understand what you want or you haven't even tried what I suggested.

 

OPT+Click, not just Click.

Edited by deanishe

Share this post


Link to post

You are perfectly right, thank you. The point is that I would like it to be included in a wider procedure and therefore be done automatically without my intervention. I wanted it to be automated via Alfred, Automator or Applescript. Does it make any sense to you or am I confusing in my description ?

Thank you for your time. I appreciate.

Share this post


Link to post

Okay then. The best way to do this is probably to simulate the CMD+OPT+Right Arrow keypress with AppleScript, like this: 
 
tell application "System Events" to key code 124 using {command down, option down}
 
In an Alfred workflow, put that in a Run Script Action with Language = /usr/bin/osascript (AS).

It's up to you to ensure that Finder is the active application and the correct folder is selected, however. If you want to automate that, too, this will show your home folder in Finder in List View:
 
property theTarget : get path to home folder
tell application "Finder"
    activate
    tell front Finder window
        set current view to list view
        reveal theTarget
    end tell
end tell

Can't say much more than that without more details of precisely what you want to do (open the same folder every time, choose the folder to open in Alfred etc.)

Edited by deanishe
Fix AS formatting

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