我正在关注 WWDC 的自动化 Javascript 演讲。以下是幻灯片 99 中的示例。 我在新安装 yosemite 时在第 3 行收到错误。
Safari = Application('Safari')
doc = Safari.document[0]
url = doc.url() // -> here
doc.url = 'http://apple.com'
最佳答案
幻灯片上有拼写错误。第二行应该是
doc = Safari.documents[0]
^
使用文档s(复数)而不是文档
。
关于javascript - 无法转换类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24131734/