Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden. Du solltest ein Upgrade durchführen oder einen alternativen Browser verwenden.
Ich würds bei grad mal 80 Liedern über Informationen bearbeiten in iTunes machen, ist man im Bearbeitungsfenster kann man ja einfach immer auf das nächste Lied weiterklicken, sollte bei 80 Titeln nicht länger als 10 min dauern.
Sei mir nicht böse, aber ich werde es nicht benutzen. Ich muss einem Program vetrauen können. Nachher löscht Du mir damit meine ganze Sammlung! Ohne Sourcen mach ich da nichts!
Ich habe selber mal ein bisschen mit Applescript hermuprobiert. Kennt sich jemand aus? Es funktioniert nicht wenn im Namen ein deutscher Umlaut vorkommt! Weiss jemand was man da machen kann?
Ansonsten tut es supi
Hier das Script:
Code:
tell application "iTunes"
if selection is not {} then
set sel to a reference to selection
repeat with aTrack in sel
set trackName to name of aTrack
if trackName contains "_" then
set newName to ""
repeat with aChar in every character of trackName
if aChar contains "_" then
set newName to newName & " "
else
set newName to newName & aChar
end if
end repeat
set name of aTrack to newName
end if
end repeat
else
display dialog "Kein Song markiert!"
end if
end tell
Das tolle ist, Du kannst damit auch Wörter oder Sätze ersetzen ;-)
Code:
tell application "iTunes"
try
-- hier ändern
set findString to "_"
set renameString to " "
set sel to selection
set fertigerTitel to ""
end try
if sel is {} then
display dialog "Bitte markieren Sie die gewünschten Titel!" buttons {"OK"} default button 1 with icon 1
else
with timeout of 30000 seconds
repeat with naechterTrack in sel
-- überprüft den Titel
try
set songTitel to name of naechterTrack as string
set anzahlStueckeCounter to 0
end try
try
if songTitel contains findString then
set AppleScript's text item delimiters to {findString}
set the titelStueckListe to every text item of songTitel
set anzahlStuecke to the number of items in titelStueckListe
repeat with titelStueck in titelStueckListe
set teilTrackListe to (titelStueck) as string
set anzahlStueckeCounter to anzahlStueckeCounter + 1
if anzahlStueckeCounter is the anzahlStuecke then
set fertigerTitel to fertigerTitel & teilTrackListe
else
set fertigerTitel to fertigerTitel & teilTrackListe & renameString
end if
end repeat
try
set name of naechterTrack to fertigerTitel
set fertigerTitel to ""
end try
else
if songTitel is equal to findString then
try
set name of naechterTrack to renameString
set fertigerTitel to ""
end try
end if
end if
end try
-- überprüft den Artist
try
set songTitel to artist of naechterTrack as string
set anzahlStueckeCounter to 0
end try
try
if songTitel contains findString then
try
set AppleScript's text item delimiters to {findString}
set the titelStueckListe to every text item of songTitel
set anzahlStuecke to the number of items in titelStueckListe
end try
repeat with titelStueck in titelStueckListe
try
set teilTrackListe to (titelStueck) as string
set anzahlStueckeCounter to anzahlStueckeCounter + 1
end try
try
if anzahlStueckeCounter is the anzahlStuecke then
set fertigerTitel to fertigerTitel & teilTrackListe
else
set fertigerTitel to fertigerTitel & teilTrackListe & renameString
end if
end try
end repeat
try
set artist of naechterTrack to fertigerTitel
set fertigerTitel to ""
end try
else
if songTitel is equal to findString then
try
set artist of naechterTrack to renameString
set fertigerTitel to ""
end try
end if
end if
end try
try
set songTitel to artist of naechterTrack as string
set anzahlStueckeCounter to 0
end try
-- überprüft den AlbumArtist
try
set songTitel to album artist of naechterTrack as string
set anzahlStueckeCounter to 0
end try
try
if songTitel contains findString then
try
set AppleScript's text item delimiters to {findString}
set the titelStueckListe to every text item of songTitel
set anzahlStuecke to the number of items in titelStueckListe
end try
repeat with titelStueck in titelStueckListe
try
set teilTrackListe to (titelStueck) as string
set anzahlStueckeCounter to anzahlStueckeCounter + 1
end try
try
if anzahlStueckeCounter is the anzahlStuecke then
set fertigerTitel to fertigerTitel & teilTrackListe
else
set fertigerTitel to fertigerTitel & teilTrackListe & renameString
end if
end try
end repeat
try
set album artist of naechterTrack to fertigerTitel
set fertigerTitel to ""
end try
else
if songTitel is equal to findString then
try
set album artist of naechterTrack to renameString
set fertigerTitel to ""
end try
end if
end if
end try
-- überprüft das Album
try
set songTitel to album of naechterTrack as string
set anzahlStueckeCounter to 0
end try
try
if songTitel contains findString then
try
set AppleScript's text item delimiters to {findString}
set the titelStueckListe to every text item of songTitel
set anzahlStuecke to the number of items in titelStueckListe
end try
repeat with titelStueck in titelStueckListe
try
set teilTrackListe to (titelStueck) as string
set anzahlStueckeCounter to anzahlStueckeCounter + 1
end try
try
if anzahlStueckeCounter is the anzahlStuecke then
set fertigerTitel to fertigerTitel & teilTrackListe
else
set fertigerTitel to fertigerTitel & teilTrackListe & renameString
end if
end try
end repeat
try
set album of naechterTrack to fertigerTitel
set fertigerTitel to ""
end try
else
if songTitel is equal to findString then
try
set album of naechterTrack to renameString
set fertigerTitel to ""
end try
end if
end if
end try
end repeat
end timeout
end if
end tell
erstmal nochmal vielen dank! da kann ich schön etwas lernen
du umgehts das problem der umlaute imho dadurch, dass du eben nicht die einzelnen buchstaben hernimmst, sondern die strings splittest. das finde ich schön! natürlich hast du so mehr code, verglichen zu meinem kurzen algorithmus (der natürlich sehr naiv läuft).
Also nochmals danke!
PS: wofür benutzt du den timeout? itunes ist doch auch so "etwas lahm"