• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Viele hassen ihn, manche schwören auf ihn, wir aber möchten unbedingt sehen, welche Bilder Ihr vor Eurem geistigen Auge bzw. vor der Linse Eures iPhone oder iPad sehen könnt, wenn Ihr dieses Wort hört oder lest. Macht mit und beteiligt Euch an unserem Frühjahrsputz ---> Klick

itunes - umlaute

  • Ersteller Serpens
  • Erstellt am

Serpens

Gast
wenn ich per applescript lieder in ne itunes playlist reinkopieren will, dann geht das gut, solange die datei keine umlaute beinhaltet, aber bei lieden von den böhsen onkelz gibt das teil mir n fehler zurück und bricht ab.

Weiß jemand wie ich es schaffe die lieder mit umlaut auch in die playlisten zu kopieren?
 

Sam Malone

Roter Delicious
Registriert
26.06.06
Beiträge
90
Hallo,
ich füge meine Lieder entweder über die Funktion "Importieren" oder per Drag & Drop in die iTunes-Bibliothek ein. Da funktionieren Umlaute problemlos.
Applescript kenne und nutze ich leider nicht.
 

Serpens

Gast
hilft mir nur leider nciht, denn ich will das mit applescript umsetzen ^
 

KÜN-Mr90

Rheinischer Krummstiel
Registriert
06.01.07
Beiträge
386
kann das vlt. ein ASCII Problem sein?
kenn mich mit dem script leider nicht so aus.
aber das Umlautproblem ist doch oft eins der Zeichencodierung wenn ich mich nicht irre.. möglicherweise kannst du dort ja eine Einstellung vornehmen!?!
 

atomfried

Leipziger Reinette
Registriert
02.04.05
Beiträge
1.804
kannn dir auch nicht helfen.... oder vielleicht doch.
eine gute idee wäre es z.b. das script zu posten
 

hubionmac

Tydemans Early Worcester
Registriert
25.06.04
Beiträge
393
Dazu habe ich auch schon mal ein Skript geschrieben... läuft auf meinem Server... Alle 12 Stunden startet Cron das Script, das scannt die Ordner (was neu ist, bzw. gelöscht wurde) und aktualisiert die iTunes Bibliothek entsprechend.

Code:
property type_list : {"MPG3", "MIDI", "AIFF", "AAC"}
property extension_list : {"mp3", "mid", "aif", "m4a"}

property add_counter : 0
property remove_counter : 0
global thefolder, makeplaylist
set add_counter to 0
set remove_counter to 0

tell application "Finder"
    --### add tracks from the scanned folders to the itunes Library
    try
        set thefolder to folder "iTunes Scan Folders" of startup disk
        set thefolder to folder "iTunes Scan Folders" of startup disk
        set thealiases to every alias file of thefolder
    on error
        make new folder at startup disk with properties {name:"iTunes Scan Folders"}
        error "A new folder called \"iTunes Scan Folders\" has been created on you startup disk. Just place aliases of the folders you would like to scan in that folder and run this script again."
    end try
end tell
if (count of thealiases) = 0 then
    error "No Aliases in the Scan Folder!"
end if

--### remove all missing tracks from the iTunes Library first =)
display dialog "Should I remove all missing tracks before adding new ones?" buttons {"Yes", "No", "Cancel"} default button {"No"} giving up after 10
set button_returned to button returned of the result
if button_returned = "" then set button_returned to "Yes"
if button_returned = "Yes" then
    remove_missing()
end if

--### make playlists for imported mp3s?
display dialog "Add mp3s to the library, or make a playlist for each imported folder?" buttons {"Lib", "Playlist", "Cancel"} default button {"Lib"} giving up after 10
set button_returned to button returned of the result
if button_returned = "" then set button_returned to "Lib"
if button_returned = "Playlist" then
    set makeplaylist to true
else
    set makeplaylist to false
end if


repeat with thealias in thealiases
    tell application "Finder"
        set this_folder to original item of thealias as alias
        set deepcount to character 1 of (name of thealias as text)
        try
            set deepcount to deepcount as integer
        on error
            set deepcount to 0
        end try
    end tell
    if deepcount = 0 then
        tell application "Finder" to set playlist_name to name of this_folder
        process_item(this_folder, playlist_name)
    else
        process_folder(this_folder, deepcount)
    end if
end repeat
--### write statistics to a logfile
write_log(thefolder, "action.log", "")

on process_folder(this_item, deepcount)
    tell application "Finder"
        set these_items to every folder of this_item
        set deepcount to deepcount - 1
    end tell
    repeat with this_item in these_items
        if deepcount = 0 then
            tell application "Finder" to set playlist_name to name of this_item
            process_item(this_item, playlist_name)
        else
            process_folder(this_item, deepcount)
        end if
    end repeat
    
end process_folder


on process_item(this_item, playlist_name)
    try
        tell application "iTunes"
            if playlist playlist_name exists then
                set change_string to true
            else
                set change_string to false
            end if
        end tell
        if change_string = true then
            set playlist_name to (playlist_name & " " & (make_datestring(current date))) as text
        end if
        tell application "iTunes"
            set prev_libcount to count of every track of playlist 1 of source 1
            if makeplaylist = true then
                set theplaylist to make new playlist with properties {name:playlist_name}
                set this_track to add (this_item as alias) to theplaylist
            else
                set this_track to add (this_item as alias) to playlist 1 of source 1
            end if
            set aft_libcount to count of every track of playlist 1 of source 1
            set add_counter to add_counter + (aft_libcount - prev_libcount)
        end tell
    on error msg
        write_log(thefolder, "action.log", msg)
    end try
end process_item


on remove_missing()
    tell application "iTunes"
        set the stored_setting to fixed indexing
        set fixed indexing to true
        set sourcename to name of source 1
        tell source sourcename
            set libname to name of playlist 1
            tell playlist libname
                repeat with i from the (count of tracks) to 1 by -1
                    try
                        if the location of track i is missing value then
                            delete track i
                            set the remove_counter to the remove_counter + 1
                        end if
                    end try
                end repeat
            end tell
        end tell
        set fixed indexing to the stored_setting
    end tell
end remove_missing

on write_log(thelocation, logname, logtxt)
    set thelocation to POSIX path of (thelocation as alias)
    if logtxt = "" then
        do shell script "echo `date \"+%y-%m-%d %H:%M:%S\"` \\ \\ \\ Tracks removed: " & remove_counter & "|cat>>" & quoted form of thelocation & quoted form of logname
        do shell script "echo `date \"+%y-%m-%d %H:%M:%S\"` \\ \\ \\ Tracks added: " & add_counter & "|cat>>" & quoted form of thelocation & quoted form of logname
    else
        do shell script "echo " & quoted form of logtxt & "cat>>" & quoted form of thelocation & quoted form of logname
    end if
end write_log

--### some time features for duplicated playlists

on get_month_number(incomingDate)
    copy incomingDate to b
    set the month of b to January
    set month_number to "0" & (1 + (incomingDate - b + 1314864) div 2629728) as text
    return (characters -2 through -1 of month_number) as text
end get_month_number

on make_datestring(thedate)
    set theday to characters -2 through -1 of (("0" & day of thedate) as text) as text
    set thestring to (year of thedate) & "-" & get_month_number(thedate) & "-" & theday & "  " & (hours of thedate) & ":" & minutes of thedate
end make_datestring
 

Serpens

Gast
okay, thx, sieht viel umfangreicher aus als meins, ich werd mich heute abend mal durcharbeiten und gucken thx
 

Serpens

Gast
ich hab mir das script mal angeschaut, aber ich verstehe nicht, wie das mit den umlauten klappen soll, zumindest finde ich in deinem script nciht die antwort :(
 

hubionmac

Tydemans Early Worcester
Registriert
25.06.04
Beiträge
393
Das Skript fügt alle Sound-Dateien eines Ordner zur iTunes Bibliothek hinzu.
Und diese auch zu einer Playlist...
Dem Skript ist es dabei egal, ob da Umlaute oder sonstige Sonderzeichen im Tracknamen sind....
Ich denke dein Problem löst Du, wenn du die Referenz zu dem Track, den Du zu seiner Playlist hinzufügen möchtest, ordentlich anlegst... Deshalb das Beispiel.
Wie möchtest Du den dem Script sagen, welche Tracks es zu einer Playlist hinzufügen soll?
Über eine Auswahl in iTunes?:
Code:
tell app "iTunes"
set these_tracks to selection of browser window 1
repeat with this_track in these_tracks
end repeat
end tell

oder über eine Finder auswahl?:
Code:
--script make Playlist of Finder Selection by hubionmac.com
tell application "Finder"
	set these_ to selection
	
end tell
if these_ = {} then
	tell me to quit
else
	repeat with this_ in these_
		tell application "Finder"
			set this_ to this_ as alias
			set playlistname to name of this_
		end tell
		tell application "iTunes"
			tell source 1
				set counter to 0
				set playlistname_ to playlistname
				repeat until 1 = 2
					if playlist playlistname_ exists then
						set counter to counter + 1
						set playlistname_ to (playlistname & " ##" & counter) as string
					else
						make new playlist with properties {name:playlistname_}
						add this_ to playlist playlistname_
						exit repeat
					end if
				end repeat
			end tell
		end tell
	end repeat
end if
 

Serpens

Gast
genial thx, ich habs jetzt mit deinem quelltext noch hinbekommen, nur ich verstehe nich was der unterscheid ist zwischen
a reference to alias of ....

und einfach nur
as alias
 

hubionmac

Tydemans Early Worcester
Registriert
25.06.04
Beiträge
393
Nun, ein Alias kann vom Finder genutzt werden... a reference in iTunes.
Da man manchmal aber infos aus dem einen oder anderen Programm im anderen verwendet, muss man diese Infos halt im richtigen Typ abspeichern, damit der Finder bzw. iTunes wissen, wovon man eigentlich spricht