2011-10-10 84 views
1

我需要一些简单的applescript帮助。我需要它使用url参数在mac上打开本地URL。通过applescript打开一个带有url参数的本地html文件

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

do shell script str 

我找不到一个方法让网页打开参数,它总是打开.html。

有人可以帮忙吗?由于

回答

0

您可能需要使用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命令是一个通用的功能,这意味着打开任何程序的任何文件。它只会查找文件位置并忽略字符串的其余部分。

+0

优秀的男人。工作过一种享受! – slinky2000

+0

只需打开位置而不创建新窗口,请尝试“告诉应用程序”Safari“打开位置”http:// ...“ – Palimondo

相关问题