打开一个本地的HTML文件通过AppleScript的网址参数 [英] Open a local html file with url params through applescript

查看:350
本文介绍了打开一个本地的HTML文件通过AppleScript的网址参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助一个非常简单的AppleScript。我需要它来打开本地URL在Mac上使用的URL参数。

I need some help with a very simple applescript. I need it to open a local URL on mac with a url parameter.

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

do shell script str

我不能找到一个办法让网页的参数打开,它永远只是打开的.html。

I can't find a way to get the webpage to open with the parameters, it always just opens the .html.

有人能帮忙吗?谢谢

推荐答案

您可能需要使用Safari浏览器,这是可脚本:

You may want to use Safari, which is scriptable:

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

打开命令是一个通用的功能,这意味着打开任何程序的任何文件。它只是寻找文件的位置和忽略字符串的其余部分。

The open command is a general-purpose function, meant to open any file with any program. It will simply look for file location and ignore the rest of the string.

这篇关于打开一个本地的HTML文件通过AppleScript的网址参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆