Applescript使用osescript和特定URL打开safari

Applescript使用osescript和特定URL打开safari,safari,applescript,Safari,Applescript,我正在尝试运行以下脚本: on run proUrl tell application "Safari" make new document with properties {URL:proUrl} end tell end run 以下是我尝试运行它的方式:osascript script.scpthttp://google.com 我收到以下错误: script.scpt:执行错误:Safari收到错误:AppleeEvent处理程序失败。(-10000)

我正在尝试运行以下脚本:

on run proUrl
    tell application "Safari"
        make new document with properties {URL:proUrl}
    end tell
end run
以下是我尝试运行它的方式:
osascript script.scpthttp://google.com

我收到以下错误:
script.scpt:执行错误:Safari收到错误:AppleeEvent处理程序失败。(-10000)

如果我将
proUrl
变量替换为
“http://google.com“
然后它就可以工作了


如何修复此问题?

proUrl是一个项目列表,即使只有一个项目发送到applescript。因此,实际的url是“proURL的第1项”。以下是我将如何编写您的脚本

on run proUrlList
    open location (item 1 of proUrlList)
end run

要从命令行在默认浏览器中打开URL,只需使用
open

open http://google.com
有关更多信息,请参见
man open