Jump to content

[Mavericks] Merge all Finder windows.


Recommended Posts

Would you want to expand this workflow to include the terminal? That would be rad. Then you could make it so that the args would be "merge finder" "merge "terminal" or something like that. Although, I haven't looked into it enough to see if it works similarly enough. If you want to get fancier, you could also try "merge safari" "merge chrome," etc... I do understand if that's adding features that you don't want to put into the workflow. If that's the case, ignore this!

Link to post

Here's a simpler version of the script for you to test. Open Applescript Editor (make sure that Applescript Editor can control your computer, so make sure that

System Preferences -> Security & Privacy -> Accessibility -> Applescript Editor 

is checked; you might have to unlock the preferences first.

 

So, then, in Applescript Editor, copy and paste this script:

tell application "Finder"
  activate
  tell application "System Events"
    tell process "Finder"
     click menu item "Merge All Windows" of menu "Window" of menu bar 1
    end tell   
  end tell
end tell

See if that merges all the finder tabs. iKam's version is better than this script, but if this one doesn't work, then I have absolutely no idea what to tell you...

Link to post

Just a hint: if any of the posters with problems happen to be running OS X in another language than English, the AppleScript will not work, as it searches for the relevant menu item by name, which, of course, is localized.

 

If that is the case, the fix is easy: check your Finder and see what your window menu is called, and what the menu item to merge windows is called, then replace the second and third argument of the click_menu call on line 2 of the AppleScript action of the workflow by the localized versions.

 

For instance, for German, replace

click_menu("Finder", "Window", "Merge All Windows")

by 

click_menu("Finder", "Fenster", "Alle Fenster zusammenführen")
Link to post

 

Just a hint: if any of the posters with problems happen to be running OS X in another language than English, the AppleScript will not work, as it searches for the relevant menu item by name, which, of course, is localized.

 

If that is the case, the fix is easy: check your Finder and see what your window menu is called, and what the menu item to merge windows is called, then replace the second and third argument of the click_menu call on line 2 of the AppleScript action of the workflow by the localized versions.

 

For instance, for German, replace

click_menu("Finder", "Window", "Merge All Windows")

by 

click_menu("Finder", "Fenster", "Alle Fenster zusammenführen")

 

Thank you! It worked for me!

Link to post

I had never thought that this could be a problem, but now that it's been pointed out, it's so completely obvious. And it probably could answer quite a few unresolved bug reports with other workflows. Great job kopischke!

 

I wrote up a post about it for the workflow help and questions forum that David pinned, so you can find it at the top. I presented two solutions. The first was just putting in a check into the Applescript to see if the language is the same one that the workflow is written for, and, if not, then opening a text file that gives instructions as to how to fix it. Sample code is in the post. The second is a much more ambitious project that I currently don't have time for but an interesting one.

Link to post
  • 4 weeks later...

Hi there,

 

just started to love Alfred today and I was looking for nice Workflows all the day. Now i saw this one and i knew i need it! Unfortunately it doesn't work for me. I changed the Names to the german ones and it still does not work. You have any advices for me?

 

Thanks:)

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