iTunes Songname auf Variable speichern

W

Wullschi

Hallo

Ich möchte den Namen eines Liedes aus iTunes (unter Ablage/Information) auf einer Variable in RealBasic speichern. WIe komme ich an diesen Pfad heran? :confused:
Wie lässt sich erkennen welches Lied gerade gespielt wird? kopfkratz

thx
Wullschi
 
garnicht, weil es nur eine iTunes API gibt die es erlaubt eigene Visual Plug-ins zu schreiben. Wenn du das machen willst siehe
 
Das stimmt nicht. iTunes kann sowohl via AppleScript als auch via Perl angesteuert werden. Beispielsweise ist es möglich, mit folgendem AppleScript Titel, Interpret und Album von aktuellen Lied in die Zwischenablage zu kopieren, um es dann weiterzuverwenden:

Code:
tell application "iTunes"
set iname to name of current track
set iartist to artist of current track
set ialbum to album of current track
end tell

tell application "Finder"
set music to "\"" & iname & "\" von " & iartist & " auf dem Album \"" & ialbum & "\"."
set the clipboard to the music
end tell

Vielleicht ist das schonmal ein Ansatz für dein "Problem" :D
 
das apple script hier hab ich auch nur woanders rauskopiert. die stelle mit dem return ist die für dich interessante.


Code:
tell application "iTunes"
	try
		set my text item delimiters to {"
"}
		set thePlayerState to the player state
		set theVolume to (the sound volume as string)
		set playerPos to (the player position as string)
		set theTrack to the current track
		
		if (the class of theTrack is URL track) then
			set theStream to (the name of theTrack as string)
			set theName to the current stream title
			return {thePlayerState, theVolume, playerPos, 1, "", theStream, theName} as string
		end if
		
		tell theTrack
			set theDuration to duration
			set theTrackNum to track number
			set theTrackCount to track count
			set theArtist to artist
			set theAlbum to album
			set theName to name
			set theRating to rating
		end tell
		
		return {thePlayerState, theVolume, playerPos, 0, theArtist, theAlbum, theName, theDuration, theRating} as string
		--return (time of current track as string)
	on error
		try
			return the player state as string
		on error
			return "error"
		end try
	end try
end tell
 
Zurück
Oben Unten