0

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);

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

Thank you for any help.

Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
pwldp
  • 31
  • 1
  • 4

1 Answers1

0

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);

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.

Maxwell77
  • 918
  • 6
  • 16
  • Thanks a lot, but I need to programmatically click a [Get] button (see screenshot: http://i58.tinypic.com/30wme1d.png). It is located below iBooks logo. It has changed in last version on iTunes. – pwldp Nov 24 '14 at 13:43