safari中的applescript关闭选项卡
与 我可以得到safari标签的名称 如何关闭具有特定名称的选项卡safari中的applescript关闭选项卡,safari,applescript,Safari,Applescript,与 我可以得到safari标签的名称 如何关闭具有特定名称的选项卡 tell application "Safari" set winlist to every window repeat with win in winlist set tablist to every tab in win repeat with t in tablist name o
tell application "Safari"
set winlist to every window
repeat with win in winlist
set tablist to every tab in win
repeat with t in tablist
name of t as string
end repeat
end repeat
end tell
告诉应用程序“Safari”关闭名称以“autom”开头的文档
将关闭包含以autom
开头选项卡的所有窗口
告诉应用程序“Safari”关闭名称以“autom”开头的文档
将关闭包含以autom
开头的选项卡的所有窗口这里是另一种方法:
tell application "Safari"
repeat with t in tabs of windows
tell t
if name starts with "autom" then close
end tell
end repeat
end tell
以下是另一种方法:
tell application "Safari"
repeat with t in tabs of windows
tell t
if name starts with "autom" then close
end tell
end repeat
end tell
这对我不起作用
他们两个都不工作
奇怪的是,当safari没有全屏显示时,它确实可以工作
我想这是safari中的一个bug,它对我不起作用
他们两个都不工作
奇怪的是,当safari没有全屏显示时,它确实可以工作
我猜这是safari中的一个bug,它工作正常,但抛出了一个奇怪的错误:执行错误:safari出错:无法获取每个窗口每个选项卡的第20项。无效索引。(-1719). 假设winlist索引关闭选项卡后不正确。嗯,是的,我很容易打开了20个选项卡:)它工作正常,但抛出了奇怪的错误:执行错误:Safari出错:无法获取每个窗口每个选项卡的第20项。无效索引。(-1719). 假设winlist索引关闭选项卡后不正确。嗯,是的,我可以轻松打开20个标签:)