使用 applescript 在现有 chrome 选项卡中打开 url?
Using applescript to open url in existing chrome tab?
我有一个简单的 applescript,我每天在 class 开始时启动它来设置我的开发环境并打开我在 Chrome 中的目录。它可以正常工作,但我是强迫症患者,希望它在您首次启动 Chrome.
时创建的现有新选项卡中打开 URL
tell application "Google Chrome"
activate
open location "http://mydir.dev"
end tell
我已经尝试搜索 Chrome 词典,但似乎找不到任何帮助。
尝试:
tell application "Google Chrome"
if not (exists window 1) then reopen
set URL of active tab of window 1 to "http://mydir.dev"
end tell
我有一个简单的 applescript,我每天在 class 开始时启动它来设置我的开发环境并打开我在 Chrome 中的目录。它可以正常工作,但我是强迫症患者,希望它在您首次启动 Chrome.
时创建的现有新选项卡中打开 URLtell application "Google Chrome"
activate
open location "http://mydir.dev"
end tell
我已经尝试搜索 Chrome 词典,但似乎找不到任何帮助。
尝试:
tell application "Google Chrome"
if not (exists window 1) then reopen
set URL of active tab of window 1 to "http://mydir.dev"
end tell