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
 

Pill

Adams Parmäne
Registriert
07.07.12
Beiträge
1.310
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