I have a macro that opens favourite folders I have, in 2 possible ways:
- If I'm working in any application, it will open the Finder window I choose;
- If I'm in an application and I want to open or save a file (and the corresponding open or save dialog box is frontmost), it will open that folder in the dialog box, so I can save my file directly where I want it to be.
My problem is detecting in which state the application is: is the frontmost window a "normal" window (like a spreadsheet, a browser window, a Word document...) or is it an open or save dialog box? Because it seems to me that applications behave differently when it comes to reporting on such a dialog box...
E.g. when using the name as a property, the open or save dialog box is called "Microsoft Excel" in Excel (a normal sheet would be called e.g. "Revenues 2019" or whatever), has no name in Chrome and so on.
So now I'm using a series of "any condition met" steps:
- Name is empty
- Name is "Microsoft Excel"
- A "New Folder" button is present (like you often, but not always, see in such dialog boxes)
All this is fine by me, but isn't there a smarter way that is more definitive?
Thanks & cheers --Mike