我正在尝试在 OSX 中选择某个终端选项卡并向其发送击键。但是 OSX 10.8.4 中的终端似乎没有为选项卡的自定义标题存储“终端”以外的任何内容,即使您使用检查器设置了自定义标题也是如此。有任何想法吗?这是我想用来选择正确选项卡的代码:
tell application "Terminal"
set allWindows to number of windows
repeat with i from 1 to allWindows
set allTabs to number of tabs of window i
repeat with j from 1 to allTabs
if custom title of tab j of window i contains "blah" then
set frontmost of window i to true
set selected of tab j of window i to true
end if
end repeat
end repeat
end tell