Applescript,Chrome:在指定索引处创建新选项卡
我有一个简单的Applescript,它在新选项卡中重新打开活动选项卡Applescript,Chrome:在指定索引处创建新选项卡,applescript,Applescript,我有一个简单的Applescript,它在新选项卡中重新打开活动选项卡 tell application "Google Chrome" tell first window set theUrl to URL of active tab set myTab to make new tab at end of tabs set URL of myTab to theUrl end tell end tell 因此,我可以在选项卡的末
tell application "Google Chrome"
tell first window
set theUrl to URL of active tab
set myTab to make new tab at end of tabs
set URL of myTab to theUrl
end tell
end tell
因此,我可以在选项卡的末尾打开选项卡
,或在选项卡的开头打开选项卡,但如何在选项卡的指定索引处打开新选项卡。我想将其作为活动选项卡后的下一个选项卡打开。您可以在活动选项卡(编号)后使用术语;像这样
tell application "Google Chrome"
tell first window
set n to active tab index
set theUrl to URL of active tab
set myTab to make new tab at after tab n with properties {URL:theUrl}
end tell
end tell