• 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

Applescript Songs in einer Playlist

  • Ersteller Serpens
  • Erstellt am

Serpens

Gast
Hallo, weiß jemand wie ich überprüfen kann ob ein lied in einer playlist drinne ist, ich versuch das jetzt schon seit tagen mit allen möglciehn kombinationen aber nix klappt, hab das gefühl ich spiele lotto
laugh.gif


Code:
              on input(dir, defPL) 
   tell application "Finder" 
      set dirName to name of dir 
      set array to every item of dir 
   end tell 
   repeat with cItem in array 
      try 
         set cName to name of cItem 
         if kind of cItem is "Ordner" then 
            if dirName is "Library" then 
               tell application "iTunes" to if not (exists playlist cName) then make new playlist with properties {name:cName} 
               input(cItem, cName) 
            else 
               input(cItem, defPL) 
            end if 
         else 
            --tell application "iTunes" to tell playlist defPL to if not (exists track cName) then  
            tell application "iTunes" 
               set tList to every track of playlist defPL 
               if cName is in tList then say "Hi" 
               --if not (exists track cName) then 
               --   add (cItem as alias) to playlist defPL 
               --say "hi" 
               --end if 
            end tell 
         end if 
      end try 
   end repeat 
end input

hier mal n bissl code
schonmal thx
 

Dante101

Ralls Genet
Registriert
11.10.05
Beiträge
5.048
Wie wärs mit der Suchfunktion von iTunes rechts oben?
 

Serpens

Gast
stimmt, daran habe ich garnich gedacht :), ich werde es mal ausprobieren thx
 

hubionmac

Tydemans Early Worcester
Registriert
25.06.04
Beiträge
393
Code:
(* Not In Any Playlist  v1.0

written by Doug Adams

Get more free AppleScripts for iTunes and
help writing your own:
http://www.malcolmadams.com/itunes/
*)
global newContents

tell application "iTunes"
    set opt1 to "Yes, Consider"
    set opt2 to "No, Ignore"
    set options1 to button returned of (display dialog "Not In Any Playlist" & return & return & ¬
        "Creates a text file that will list the library tracks which are not assigned to any iTunes playlists." & return & return & ¬
        "                          " & " Consider Smart Playlists also?" buttons {"Cancel", opt1, opt2} default button 3 giving up after 300)
    
    
    
    display dialog "Gathering information..." buttons {""} giving up after 2
    
    set lib to a reference to library playlist 1
    set c to count of every track of lib
    set everyP to (get a reference to every user playlist)
    set allIDs to {}
    
    
    tell source 1
        set playlistname to ("•Not in any playlist: " & (current date)) as text
        set theplaylist to make new playlist with properties {name:playlistname}
    end tell
    
    
    with timeout of 300000 seconds
        repeat with thisP in everyP
            if (class of thisP) is user playlist then
                if options1 is opt2 and smart of thisP is true then
                    -- fugedabowdit
                else
                    repeat with tt from 1 to (count of every track of thisP)
                        copy (get database ID of track tt of thisP) to anid
                        if anid is not in allIDs then copy anid to end of allIDs
                    end repeat
                end if
            end if
        end repeat
    end timeout
    
    display dialog "Checking tracks..." buttons {""} giving up after 2
    set newContents to {}
    repeat with tt from 1 to count of every track of lib
        with timeout of 300000 seconds
            set aTr to (a reference to track tt of lib)
            set theID to database ID of aTr
            
            if allIDs does not contain theID then
                set this_track to (every track of library playlist 1 whose database ID is theID)
                try
                    copy item 1 of this_track to playlist playlistname of source 1
                end try
            end if
            
        end timeout
    end repeat
end tell