Push-Nachrichten von MacTechNews.de
Würden Sie gerne aktuelle Nachrichten aus der Apple-Welt direkt über Push-Nachrichten erhalten?
Forum>Entwickler>Applescript iTunes can't make class

Applescript iTunes can't make class

Happymacler^^01.01.1217:25
Hallo,
ich versuche in Applescript einen neuen file track zu erstellen, hier der Code:


tell application "iTunes"
    
    set theTRack to (make new file track at library playlist with properties {location:"Macintosh HD:Users:DerUser:Desktop:Recordings:Smells Like Teen Spirit Nirvana.mp3"})
    
end tell

laut Doku sollte das so funktionieren, aber ich bekomme immer folgenden Error:
error "iTunes got an error: Can’t make class file track." number -2710 from file track to class

Hier noch die Definition von file track:
file track n [inh. track > item] : a track representing an audio file (MP3, AIFF, etc.)
elements
contained by library playlists, user playlists.
properties
location (alias) : the location of the file represented by this track

Was mache ich falsch?

Viele Grüße
0

Kommentare

Happymacler^^01.01.1217:58
P.S. Ich benutze iTunes 10.5.2 also das aktuellste.
0
_mäuschen
_mäuschen02.01.1200:15

tell application "iTunes"
   set theTRack to (add "Macintosh HD:Users:DerUser:Desktop:Recordings:Smells Like Teen Spirit Nirvana.mp3")
end tell

0
Happymacler^^02.01.1213:49
Eine Lösung, aber warum kann iTunes die Klasse nicht erstellen? Ist das Dictionary nicht mehr aktuell oder wie darf man das verstehen? Einen URL track kann ich auch nicht erstellen, ich habe iTunes neu installiert mit demselben Ergebnis.
0
_mäuschen
_mäuschen02.01.1214:10

0
_mäuschen
_mäuschen02.01.1215:07


                                            URL

tell application "iTunes"
    set stream_URL to "http://s10.pop-stream.de:10010"
    set my_playlist to "myURL"
    if not (exists playlist my_playlist) then
        make new user playlist with properties {name:my_playlist}
    end if
    
    open location stream_URL
    stop -- don't play right away
    set new_stream to (some URL track of library playlist 1 whose address is stream_URL)
    duplicate new_stream to playlist my_playlist
    set view of front browser window to playlist my_playlist
    tell playlist my_playlist
        play track (get name of new_stream) -- play it now
    end tell
end tell
Found on the Web

0
Happymacler^^02.01.1222:07
Es ging mir auch nicht um einen URL track explicit, sondern darum Dateien mit iTunes zu bearbeiten, ohne sie zur iTunes - Library hinzufügen zu müssen. Das scheint nicht zu funktionieren, da immer ein "add" im Spiel ist, aber vielen Dank für deine Hilfe
0

Kommentieren

Diese Diskussion ist bereits mehr als 3 Monate alt und kann daher nicht mehr kommentiert werden.