Question

I am working on an AppleScript to toggle between minimize and maximize of specific windows. I have it working pretty well. But I am running into a specific issue with one application the MOG app for Mac does not seem to have a variable for miniaturize, collapse, or minimize.

I know that I could use click to toggle the window, but I would prefer a solution that works with the API.

Here is the applescript just for MOG:

tell application "MOG"
    set (miniaturized of windows whose miniaturizable is true) to true
end tell 

I would really appreciate it if someone could point me in the right direction.

Was it helpful?

Solution

Not every application is going to allow something like miniaturization of windows via AppleScript, even when the application is scriptable. One way to find out the properties of an application's window:

tell application "MOG"
    get properties of window 1
end tell

You can also open the MOG dictionary and find out what you're able to script. Pressing cmd-shift-o will open a window listing all applications' scripting dictionaries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top