我尝试获取一个应用程序的标题(并将其复制为变量)
到目前为止,这是我的代码,但是它失败了。
tell application "app"
activate
end tell
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
tell application frontApp
if the (count of windows) is not 0 then
set window_name to name of front window
end if
end tell
结果:
错误 "应用程序出错:每个窗口都不理解“count”信息。" 编号 -1708 来自每个窗口