OS X约塞米蒂JavaScript进行自动化和iTunes [英] OS X Yosemite Javascript for Automation and iTunes

查看:256
本文介绍了OS X约塞米蒂JavaScript进行自动化和iTunes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想点击按钮自由在iTunes下载的应用程序。
我使用JavaScript自动化打开iTunes应用程序页面:

I'm trying to click on button "Free" to download application in iTunes. I'm using Javascript for Automation to open iTunes application page:

itunes = Application('iTunes');
itunes.activate();
console.log( itunes.name() );
console.log( itunes.version() );
delay(1)
appUrl = "itms://itunes.apple.com/us/app/ibooks/id364709193?mt=8";
win = itunes.openLocation(appUrl);

脚本打开iBook的页面。如何找到并点击按钮自由?
如何列出打开页面上的所有元素?

The script opens iBook page. How to find and click button "Free"? How to list all elements on open page?

感谢您的任何帮助。

推荐答案

看在脚本编辑器后,iTunes应用程序库中,我并没有发现任何方法或对象处理在iTunes Store中的书籍。所以,我认为,这是一个死胡同。该iBooks的应用程序没有编写脚本的反正。

After looking in the script editor, the library for the Itunes Application, i didn't found any method or object dealing with books in the itunes store. So i think, it's a dead end. The iBooks application is not scriptable anyway.

然而,为了您的问题继续,点击[免费]按钮:

However to go ahead with your problem, clicking the [Free] button :

appUrl = "itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=38&popId=42";
win = itunes.openLocation(appUrl);

针对的URL在 [免费] 按钮可以通过浏览书籍在iTunes中,在界面的右侧找到(自由书,右键集团公司=>复制链接) 。也许URL是您的美国版本不同,但你有这个想法。

The URL targeted by the [Free] button could be found by browsing books in iTunes, in the right side of the interface ( "Free books", right-clic => Copy the link ). Perhaps the URL is different for your US version but you got the idea.

这篇关于OS X约塞米蒂JavaScript进行自动化和iTunes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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