I’m working on a script and had a question. I want to raise all windows of some app (which has the focus and is scriptable but is otherwise unspecified) above all other apps. Right now I use GUI scripting, which does what I want, although I prefer to not use GUI scripting if that’s possible.
tell application "System Events"
set activeApp to name of first process whose frontmost is true
tell process activeApp
click menu item "Bring All to Front" of menu "Window" of menu bar 1
end tell
end tell
An alternative that also works but is a bit visually intrusive is:
tell application "System Events"
set activeApp to name of first process whose frontmost is true
tell process activeApp
set windowCount to (count windows)
repeat windowCount times
tell window windowCount to perform action "AXRaise"
end repeat
end tell
end tell
Is there another alternative? I thought there might be an AXRaiseAll action or an ASObjC solution but couldn’t find anything. Thanks.