的AppleScript在Safari中打开崩溃URL基于Flash的网站 [英] AppleScript to open URL in Safari crashes for Flash-based websites

查看:297
本文介绍了的AppleScript在Safari中打开崩溃URL基于Flash的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Safari中打开一个URL。它工作正常的没有Flash嵌入网站,但Safari浏览器崩溃的Flash网站。

I'm trying to open a URL in Safari. It works fine for websites without Flash embedded, but crashes Safari for Flash sites.

示例(工程):

tell application "Safari" to open location "http://google.com"

这崩溃,当Safari浏览器尚未运行:

This CRASHES when Safari is not already running:

tell application "Safari" to open location "http://grooveshark.com"

两件事情,我注意到:

Two things I noticed:


  • Safari浏览器只能用嵌入式闪存
  • 崩溃的网站
  • 如果创建Safari浏览器的一个新实例只是上面的脚本崩溃(即野生动物园之前没有运行)

从第二个观察我认为它可能是某种形式的权限问题。也许从AppleScript的推出Safari浏览器实例都有一个问题加载插件?

From the second observation I assume that it could be a permission issue of some sort. Maybe the Safari instance launched from the AppleScript has a problem loading plugins?

推荐答案

你知道开放位置不是Safari浏览器的AppleScript命令?因此,你不应该告诉Safari浏览器来运行该命令。 打开位置是标准的补充的AppleScript和它用于打开在处理URL中的默认应用程序的URL。另外,如果是Safari浏览器为用户默认的应用程序,如果它崩溃如果Safari尚未运行,那么为什么不先推出Safari浏览器,然后打电话给你的命令我没有尝试这样做......它只是一个建议...

Did you know "open location" is not a Safari applescript command? As such you shouldn't tell safari to run that command. "Open location" is in the standard additions to applescript and it's used to open a url in the default application that handles the url. Plus, if Safari is the default application for a user, and if it crashes if safari isn't already running, then why not launch safari first, then call your command... I haven't tried this... it's just a suggestion...

tell application "Safari" to launch
open location "http://grooveshark.com"

顺便说一句,如果你想确保使用Safari,那么你打开URL像这样...

By the way, if you want to make sure safari is used, then you open the url like this...

tell application "Safari"
    launch
    make new document
    tell document 1 to set URL to "http://grooveshark.com"
end tell

这篇关于的AppleScript在Safari中打开崩溃URL基于Flash的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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