hi, itunes brings a new feature....search ... accessible by applescript
i edited the clutter file named PlayArtistAlbum.scpt
(inside the application packege)
HERE IS THE CODE...
MUCH MUCH FASTER CLUTTER NOW
(if you have a huge amount of files managed by itunes)
i edited the clutter file named PlayArtistAlbum.scpt
(inside the application packege)
HERE IS THE CODE...
MUCH MUCH FASTER CLUTTER NOW
(if you have a huge amount of files managed by itunes)
Code:
[SIZE=1]on clutterPlaylist(src)
tell application "iTunes"
tell src
-- Find or create a playlist named "(Clutter)":
if (first user playlist of src whose name is "(Clutter)") exists then
set pl to first user playlist of src whose name is "(Clutter)"
else
set pl to (make new user playlist in src)
set name of pl to "(Clutter)"
end if
return pl
end tell
end tell
end clutterPlaylist
on open info
tell application "iTunes"
with timeout of 30 seconds
set theArtist to item 1 of info
set theAlbum to item 2 of info
set theTrack to item 3 of info
if theArtist = "" then set theArtist to null
--display dialog "theArtist=" & theArtist & ", theAlbum=" & theAlbum
repeat with src in every source
repeat with pl in every library playlist of src
set oldShuf to (shuffle of pl)
set shuffle of pl to false -- otherwise tracks are copied to dstPl in random order!
set dstPl to my clutterPlaylist(src)
delete tracks of dstPl
set searchpattern to theArtist & " " & theAlbum
set newP to (make new playlist with properties {name:("test")})
repeat with aTr in (search pl for searchpattern)
duplicate aTr to newP
end repeat
duplicate (every track of newP) to dstPl
set n to the number of items of the result
set shuffle of pl to oldShuf
try
delete newP
end try
if n > 0 then
-- Success!
set view of browser window 1 to dstPl
if theTrack = null or theTrack = "" then
play dstPl
else
play track theTrack of dstPl
end if
return true
end if
end repeat
end repeat
return false
end timeout
end tell
end open
on run
-- for debugging, so it can be run in the Script Editor
open {"de la soul", "dead", ""}
end run[/SIZE]
Last edited by a moderator: