1

我需要一个非常简单的applescript的帮助。我需要用 url 参数在 mac 上打开本地 URL。

set str to "open -a 'Firefox' file:///Users/bob/Desktop/someFolder/index.html?val=28"

do shell script str

我找不到用参数打开网页的方法,它总是只打开.html。

有人可以帮忙吗?谢谢

4

1 回答 1

1

您可能想要使用可编写脚本的 Safari:

tell application "Safari"
    make new document with properties {URL:"http://stackoverflow.com/questions/7710803/open-a-local-html-file-with-url-params-through-applescript?bob=bob"}
end tell

open命令是一个通用功能,旨在用任何程序打开任何文件。它只会查找文件位置并忽略字符串的其余部分。

于 2011-10-10T15:30:34.580 回答