iTunes: Bewertungen in die Datei schreiben?

24/11/2010 - 15:07 von Andreas Keppler | Report spam
Hallo!

Gerade habe ich festgestellt, dass iTunes eine Liedbewertung (die
Sterne) nicht in die Datei selbst schreibt!

Könnte man dies irgendwo veranlassen?

Die Cover selbst können ja z.B. in die Lieddatei selbst geschrieben
werden!


Danke!

Gruß
Andreas
 

Lesen sie die antworten

#1 ordner-spamverdacht
24/11/2010 - 16:43 | Warnen spam
Andreas Keppler wrote:

Könnte man dies irgendwo veranlassen?



z.b. per Applescript in die comments..

(*
* iTunes Rate_O_Matic.scpd
* @version 0.1.1
*)
tell application "iTunes"
set counter to 0
if selection is not {} then
set track_selection to selection
with timeout of 30000 seconds
set rate_dialog to button returned of (display dialog "Backup or restore iTunes ratings - Choose your poison.." buttons {"BACKUP to comment", "RESTORE from comment", "Cancel"} default button 3 with icon 1)
repeat with this_track in track_selection
if rate_dialog is "BACKUP to comment" then
set counter to my move_to_comment(this_track, counter)
else
set counter to my move_to_rating(this_track, counter)
end if
end repeat
end timeout
else
display dialog "Select some tracks first..." buttons {"Cancel"} default button 1 with icon 2 giving up after 15
end if
display dialog "Done. " & counter & " ratings transferred." buttons {"Ok"} default button 1 with icon 1
end tell

to get_comment_rating(track_comment)
try

set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"<rating>"}
set tmp to every text item of track_comment
set AppleScript's text item delimiters to {"</rating>"}
set tmp to every text item of (item 2 of tmp)
set comment_rating to item 1 of tmp
return (comment_rating as integer)
set AppleScript's text item delimiters to oldDelims -- restore them
on error
set AppleScript's text item delimiters to oldDelims -- restore them in case something went wrong
end try
end get_comment_rating

to wipe(this_comment)
try
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"<rating>"}
set tmp to every text item of this_comment
if (count items of tmp) > 1 then -- rating tag found
set part1 to item 1 of tmp
set AppleScript's text item delimiters to {"</rating>"}
set tmp to every text item of (item 2 of tmp)
set part2 to item 2 of tmp
set this_comment to part1 & part2
return (this_comment as text)
else -- no rating tag found
return ((item 1 of tmp) as text)
end if
set AppleScript's text item delimiters to oldDelims -- restore them
on error
set AppleScript's text item delimiters to oldDelims -- restore them in case something went wrong
end try
end wipe

to move_to_comment(this_track, counter)
tell application "iTunes"
try
set id_rating to (get this_track's rating)
if id_rating > 0 and id_rating ≤ 100 then
set this_comment to (get this_track's comment)
set this_comment to my wipe(this_comment)
set this_track's comment to ("<rating>" & id_rating & "</rating> " & this_comment)
set counter to counter + 1
end if
end try
return (counter)
end tell
end move_to_comment

to move_to_rating(this_track, counter)
tell application "iTunes"
try
set track_comment to (get this_track's comment)
set comment_rating to my get_comment_rating(track_comment)
if comment_rating > 0 and comment_rating ≤ 100 then
set comment_rating to comment_rating
set this_track's rating to comment_rating
set counter to counter + 1
end if
end try
return (counter)
end tell
end move_to_rating

ben

Ähnliche fragen