Nope. The miniaturised
property is a property belonging to window
class objects of a scriptable application
. Although they share the same human-readable term, the window
element of System Events is a subclass of UI element
, and is a child of a process
(or application process
) object. Whilst process
and application process
are synonyms that form identical references, and are thus interchangeable, the application.window
class and application('sevs').process.window
class are distinct and so are not aware of each other’s scripting terms.
It’s not clear whether you specifically want to restore a single window in the case where multiple windows are minimised, or whether you wish to restore all windows but typically only have one minimised at a time.
I’ll cover both situations.
To restore a single minimised window (usually, this will be the window of the particular application that was minimised most recently):
tell application id ("com.apple.systemevents") to tell (process 1 ¬
where it is frontmost) to tell (windows whose attribute named ¬
"AXMinimized"'s value is true) to if (it exists) then set the ¬
value of its attribute named "AXMinimized" of item 1 to false
Or, to restore all windows of an application that have been minimised:
tell application id ("com.apple.systemevents") to tell (process 1 ¬
where it is frontmost) to tell (windows whose attribute named ¬
"AXMinimized"'s value is true) to if (it exists) then set the ¬
value of its attribute named "AXMinimized" to false
This is identical to the previous script except for the omission of "of item 1"
in the final clause. However, since the result of restoring all minimised windows will necessarily be such that none of the application’s windows will be minimised, you can probably get away with the slightly briefer:
tell application id ("com.apple.systemevents") to tell (process 1 ¬
where it is frontmost) to set the value of the attribute named ¬
"AXMinimized" of every window to false
If my scripts above happen to suffer with the same issue, then it is likely that the Chrome window you wish to restore belongs to a different process than the Chrome application that has focus, for example, if you were using a progressive web app that runs in its own Chrome instance, or if you opened up a separate instance of Chrome yourself.