【发布时间】:2022-12-01 14:08:42
【问题描述】:
I am using apple script to get frontmost app window title. However I can get the frontmost window but not the main window of the app. How can I do it with Apple Script?
Script:
delay 2
global frontApp, frontAppName, windowTitle
set windowTitle to ""
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
tell process frontAppName
tell (1st window whose value of attribute "AXMain" is true)
set windowTitle to value of attribute "AXTitle"
end tell
end tell
end tell
return windowTitle
In MSWord With this script I can get the name Document1 when there is no modal window in the main window. But If there is an model window for example Insert Table I am able to get the title Insert Table instead of Document1. But I need the main window title but not model window/sub windows.
Please help to to achieve this. Thank you
【问题讨论】:
-
Hi, did you find the answer to your question? I am trying to do the same thing.
-
@AriG No I didn't found
标签: macos applescript