Applescript可以发送获取或发布请求吗?

时间:2012-10-01 18:29:12

标签: php macos get applescript

我使用Hazel在Mac上整理下载的文件。我发现每次触发规则时我都可以让它运行应用程序。

我想知道是否可以发送类似的内容:

http://my.server.com?type=Show&name=Big+Bang+Theory

然后我可以创建一个记录所有下载的小页面。

1 个答案:

答案 0 :(得分:13)

当然,命令行实用程序curl是单向的。 Applescripts可以使用命令行实用程序和“do shell script”命令。所以试试这个......

set theURL to "http://my.server.com?type=Show&name=Big+Bang+Theory"
do shell script "curl " & quoted form of theURL

以上将页面结果返回到applescript。也许您只想在默认浏览器中打开链接...

set theURL to "http://my.server.com?type=Show&name=Big+Bang+Theory"
open location theURL

所以请你选择!

相关问题