Determining if an Open or Save dialog box is open

Hello,

How can I tell using either KM and/or Applescript if in my frontmost application I have either an Open or a Save dialog box open?

Use case: I looked at Default Folder X but I don’t really like it. I have palette which opens a specific list of folders in the Finder, the folders I use most often. I’d like to use that same palette, but if an Open or Save dialog box is open, I’d like to use the command-shift-G shortcut to open that specific folder in the Open or Save dialog box…

Thanks & cheers --Mike

You can use a "If/Then" Action with a "Button" condition, like this:

Michael,

Perhaps the script I use for Google Chrome that was provided by ccstone can be modified to satisfy your request:

Keyboard Maestro “Execute an AppleScript” Action

Execute an AppleScript.kmactions (1.6 KB)

Thanks both for your suggestions, I went with the KM check if buttons (Open or Save) are visible. The AppleScript way is unfortunately not universal… If you test it a bit with different applications, you’ll notice that some need “sheet 1 of window 1”, but others consider it a standard window, and yet others do not even respond to sheet 1…

But I got a working KM palette now with a bunch of destinations that in a normal situation open that folder in the Finder, but if a dialog box is open, it will open that folder in the dialogbox. Thanks!

Cheers --Mike

@Michiel, If one of the above posts solves your problem/question as originally stated, please check the “Solved” checkbox (click for details) at the bottom of that post.

Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.

Done!

Cheers --M.