I have a question regarding the Finder windows. How to come up with a macro which allows me to toggle between showing and hiding specific Finder window by the same hotkey trigger (F5)? Specifically, I want to use F5 to show Finder with opened 'X' folder and then by tapping again - hide it. And that works fine, no troubles, but the problem comes when I also want to have F6 to trigger show/hide of 'Y' location.
I kind of came up with that sort of thing, but the hotkeys are triggering each actions - when I press F5 to show Finder with opened 'X' folder and then I press F6, it doesn't open another Finder window with 'Y' folder, but closes the 'X' folder window instead.
How to avoid that? I would be really grateful for any help.
Thanks for your reply and apologize not sending my macros. Here are the macros I came up with which kind of works, but at certain circumstances they do things I don't really want.
If I close Finder window by clicking the red X using just mouse, then I have to tap F5 twice if I want to reopen Finder, probably because 'Set Variable to Text' actions doesn't switch by a mouse-click and only the chosen hotkey instead, which now in my case is F5
Sometimes to start running the 'whole thing' (so the 'Set Variable to Text' start switching between each other and start doing their thing) I have to tap multiple times like sometimes at least 5, so that's not a good setup I came up with I guess.
I tried the macro you sent me and it works great, but it doesn't close my Finder window at all even if there's an action created for it (I don't know why). Also if I go further to the folder structure (and the folder name becomes different than specified in a macro) it opens up another Finder window with specified folder but doesn't do two things I want in that case: either 1. close Finder window or 2. bring to front if not frontmost. However, great thing is that I don't have to tap twice for it two reopen if I use a mouse-click for closing, of course because it's not driven by the switches, but the Finder title actions instead.
My desired result is something I could possibly call a balance between those two. So I don't have to tap twice at times, and also even if I go further to the folder structure - it executes actions to the window I've gone further in and does not opens another Finder window.
Also I'd love to have that two macros (F5 and F6) working independently so if I press F5 for whatever action - be it open Finder window, close Finder window, or bring to front - I want it to only execute actions for that particular macro and not the other one. So for example if I have an opened Finder window executed by F5 and then I hit F6 - Finder opens up another window with the folder specified in F6 macro, and that's the only case when I want to Finder open another window instead of closing the first one. Same thing the other way around.
I would really love and be very grateful for any help achieving this, which for me in general is a very very hard time and bursting brain, so to speak
I did my best to explain what I want, but please forgive me if some of my desires are confusing.
I think I handled some of that stuff the way I wanted, thanks. I only have the issue with this:
You're manually moving around the file system in the front Finder window?
The anwser is yes - when I manually go to any of the subfolders within the folder, for which I've created the hotkey to open it, then I switch to another application (Finder becomes hidden behind it), and then if I press that hotkey again (to bring back to front Finder window with the folder I've manually moved to and which just has hided behind the app) - it opens up another additional instance of Finder window instead or bringing to front the first window. So in result it looks like this:
What I want is just to bring to front Finder window with the folder I've manually moved to [Booms] and not open another instance of Finder window [03-Kontakt Library Aliases]. Maybe the cause is that when I hit the hotkey again, it is relooping the macro again, hence opening another window [03-Kontakt Library Aliases] (which I typed a path for in the 'Set Variable local_FolderPath to ...' action, orange colored in the macro you helped me with?
The cause is a failure to communicate. You didn't specify you wanted to be able to change the target location of a given window and yet reuse that altered window as your working window.
Ordinarily when targeting windows in the Finder you use their specific target location and/or name. In your case that's not possible.
What I've had to do to accommodate you is use a mix of target location and Window ID specifiers in AppleScript and save the Window ID in a Keyboard Maestro variable.