在applescript中获取当前adobe reader窗口标题
我写了以下代码片段来获取firefox窗口的标题在applescript中获取当前adobe reader窗口标题,applescript,adobe-reader,Applescript,Adobe Reader,我写了以下代码片段来获取firefox窗口的标题 tell application "Firefox" set window_name to name of front window display dialog window_name end tell 它工作得很好,但是当我将firefox更改为adobe时,我得到以下错误 “Adobe Reader出现错误:无法获取窗口1的名称。” 有人知道如何获得窗口标题吗?问题的答案是你写的 tell application "Sy
tell application "Firefox"
set window_name to name of front window
display dialog window_name
end tell
它工作得很好,但是当我将firefox更改为adobe时,我得到以下错误
“Adobe Reader出现错误:无法获取窗口1的名称。”
有人知道如何获得窗口标题吗?问题的答案是你写的
tell application "System Events" to set adobe_windows to (get the title of every window of every process whose name contains "Adobe") as list
set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to {", "}
set adobe_windows to adobe_windows as string
display dialog adobe_windows
set AppleScript's text item delimiters to prevTIDs
当我遇到与窗口标题相关的错误时,我会转到
系统事件
寻求帮助。这甚至适用于查找者<代码>系统事件可以完成Finder所能做的一切,有时甚至更多。如果您有任何问题,请提问。:) 非常感谢你!,我是Applescript新手,所以我将进一步调查(我得到一个空字符串,但在打扰您之前,我会做我的家庭作业,:)Cheers@Pompon在运行脚本之前,请确保Adobe已实际打开。否则,它将返回一个空字符串。如果Adobe确实处于打开状态,但返回的字符串仍然为空,请告诉我,我将为您更新答案。:)Adobe reader已打开,脚本返回空字符串,非常感谢您的帮助