• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iTunes script problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes script problems


  • Subject: Re: iTunes script problems
  • From: "Stockly, Ed" <email@hidden>
  • Date: Fri, 20 Nov 2009 16:46:47 -0800
  • Thread-topic: iTunes script problems

Title: Re: iTunes script problems
With some inspiration from Doug's AppleScript's and a few minutes of tweaking, here's a snippet that does pretty much what you want.

HTH,

ES

-------------
tell application "iTunes"
    if exists playlist "Temp" then
        set myplayList to playlist "Temp"
    else
        make new playlist at beginning with properties {name:"Temp"}
    end if
    delete every track of myplayList
    set myTunes to get search playlist "Sad Songs" for "Zevon"
    
    repeat with thisTune in myTunes
        set trackID to (get database ID of thisTune)
        if not (exists (some track of myplayList whose database ID is trackID )) then
            duplicate thisTune to myplayList
        end if
    end repeat
    reveal (track 1 of myplayList)
    play (track 1 of myplayList)
end tell
------------


On 11/20/09 8:39 AM, "Chuck"  wrote:

> You're probably right in that it is more energy than I want to put  
> out. I have been working on this for 2 days without success, hence the  
> request for help.
>
> I am thinking I need to find a simpler solution and will probable just  
> make some smart playlists of my favorite artists. That is easy to do  
> but just not as flexible.
>
> Thanks for your help.
>
> Chuck
>
> On Nov 20, 2009, at 8:25 AM, LuKreme wrote:
>
>> On 20-Nov-2009, at 08:50, Chuck wrote:
>>
>>> According to the AS dictionary: search v : search a playlist for  
>>> tracks matching the search string. Identical to entering search  
>>> text in the Search field in iTunes.
>>>
>>> If the search was identical then the only songs that would be  
>>> visible, and therefor the only songs that would play, would be the  
>>> ones that were searched.
>>
>>
>> I will say that what you want to do IS possible, it's just a few  
>> more steps than you are willing to take (and to be fair, more than I  
>> was willing to take as well).
>>
>> I just went with searching for specific songs
>>
>> set mytrack to (first track of view of front window whose (name  
>> contains "$2" and artist contains "$3"))
>> play mytrack
>>
>> <http://kreme.homeip.net/itunes.txt>
>>
>> --
>> "Two years from now, spam will be solved," -- Bill Gates, January,
>> 2004
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list      (applescript-
>> email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> ac.com
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> com
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: iTunes script problems (From: Chuck <email@hidden>)

  • Prev by Date: Re: iTunes script problems
  • Next by Date: Re: TextEdit Slash SearchReplace impossible (was Basic Script Blues)
  • Previous by thread: Re: iTunes script problems
  • Next by thread: Re: iTunes script problems
  • Index(es):
    • Date
    • Thread