• Wieder einmal haben uns unsere Apfeltalker tolle Fotos zur Abstimmung eingesandt. Welches ist Euer Favorit? Stimmt mit ab! Hier geht es zur Abstimmung --> Klick
  • Es ist bereits Apfeltalk-Tradition und wir möchten sie auch in diesem Jahr fortsetzen: Unser Apfeltalk-Weihnachtslogo-Wettbewerb hat begonnen! Gestaltet für uns das Weihnachtsbanner, das im Monat Dezember bis zum Weihnachtsfest unsere Webseite schmücken soll. Lasst Eurer Kreativität freien Lauf! Hier geht es zum Wettbewerb --> Klick

Download App Itunes

blurry333

Erdapfel
Registriert
30.10.14
Beiträge
1
Hallo ,

ich moechte die ntv App automatisch mit Applescript downloaden.
Man kann ja mit Applescript soviel machen was ITunes anbelangt.
Also muesste doch auch der automatische Download einer App funktionieren.

Dieser Code geht leider nicht :(

tell application "iTunes"
activate
download "https://itunes.apple.com/de/app/n-tv/id337056601?mt=8"
end tell
 
Hallo,

ganz so einfach geht es nicht. Hier mal ein Ansatz:

Code:
set appURL to "itunes://itunes.apple.com/de/app/n-tv/id337056601?mt=8"
set thePassword to "Passwort"


tell application "iTunes" to activate
tell application "Safari"
    -- App im Store öffnen
    open location appURL
end tell
tell application "System Events"
    tell process "iTunes"
        -- warten, bis Seite geladen ist
        repeat until exists button 1 of group 3 of UI element 1 of scroll area 1 of splitter group 1 of window 1
            delay 0.2
        end repeat
        -- Download Button klicken
        click button 1 of group 3 of UI element 1 of scroll area 1 of splitter group 1 of window 1
        -- warten bis Passwortdialog erscheint
        repeat until description of window 1 is "Dialog"
            delay 0.2
        end repeat
        -- Passwort eingeben
        keystroke thePassword
        -- Enter drücken
        key code 36
    end tell
end tell