2011-10-10 30 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

相關問題