Opens a second finder window if one is already openMacro (v10.2)
Open Finder.kmmacros (4.6 KB)
No, it really really doesn't do that. All it does is open a new Finder window.
Working through the logic:
WindowCount
is set to 0
More subtly -- you only need the AppleScript if the Finder is not the frontmost application when you run the macro. And using an AppleScript action is an unnecessary "expense" when you can command an app "directly". Since you most likely want to be in the Finder after you've created a new window (and assuming you need a macro rather than just using ⌘N either via the keyboard or a Stream Deck button):
If you're going to use AppleScript anyway then make full use of it...
tell application "Finder"
if not (exists of window 1) then
make new Finder window
else
# Whatever...
beep
end if
end tell
Now THAT was / is an elegant solution. That is exactly what I wanted to do. I think I have narrowed down my personal issue with this.
I need to put effort into understanding the actions panel and, like you say, get to the root of what I actually want to do and why. THEN start looking for a solution.
At the moment, I am just using KM with Stream Deck for one push button functions to open apps. (so pretty basic) Now you have educated me by showing how I can automate the selection of menu items, I am thinking of other things to do.
(BIG THANKS FOR THAT)