ITunes User Playlist Id

How do can I get my AppleScript to get the user playlist id of a song? For example:
tell application "iTunes"
set thePlaylist to user playlist id of current track
end tell
How can I get something that functions like that theoretically should? If you just put "current track" it will show the user playlist id, I just don't know how to grab that number.

Hello Neil D,
You may try something like the following script.
Note that [application's object specifier as record] coercion may work in some cases but not in others. Also, if the application has its own 'record' defined, you'd need to use 'as «class reco»' instead of 'as record' in the coercion statement in order to avoid terminology conflict.
The code below is tested fine with iTunes 2.0.4 under OS9.1. Don't know about recent versions.
Good luck,
H
PS. I'm not sure how safe it would be to use those playlist id's in real scripts. Are they guaranteed unique and static? Or how persistent? You'd better check it.
-- SCRIPT
tell application "iTunes"
if player state is playing then
set p to container of current track
set i to (p as record)'s «class seld»
--set i to (p as «class reco»)'s «class seld» -- in case of terminology conflict
return {p, i}
end if
end tell
-- END OF SCRIPT
Message was edited by: Hiroto

Similar Messages

  • Delete Track from iTunes Library if in User Playlist

    Hello
    I want to delete [music] tracks from the main iTunes [10.7] library if they are in a user playlist.
    I saw (on dougscripts.com) an approach where the database id was obtained from the track in the playlist and this was then used to delete from the main library.  However, it does not seem to work:
                        delete (some track of thePlaylist whose database ID is (get database ID of deleteTrack))
      returns error -1708 "... doesn't understand the delete message"
    I think this is to do with a change to the way in which the main library is referenced, but if anyone can shed some light it would be much appreciated.
    Thanks.

    I found out what is happening: the tracks are shared from iCloud - via iTunes Match - which renders them un-deletable by AppleScript!

  • Is it possible to create a playlist and share it with another itunes user?

    Is it possible to create a playlist and share it with another itunes user?

    try this out
    Select distinct   
    v_R_System.Netbios_Name0 AS [Computer Name],  
    v_GS_COMPUTER_SYSTEM.UserName0 AS [User Name]
     from v_R_System
    left join v_GS_COMPUTER_SYSTEM on (v_GS_COMPUTER_SYSTEM.ResourceID = v_R_System.ResourceID) 
    inner join v_fullcollectionmembership as b on (b.ResourceID = v_R_System.ResourceID) 
    left join v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP ON v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.ResourceID = v_R_System.ResourceID
            inner join v_GS_SYSTEM e on e.resourceid = b.resourceid
     Where
    b.CollectionID = @collectionid
    Blog: http://theinfraguys.com
    Follow me at Facebook
    The Infra Guys Facebook Page
    Please remember to click Mark as Answer on the answer if it helps you in anyway

  • Selecting a user playlist as source in Itunes DJ

    Hi,
    I'm using iTunes 9 with Apple script version 2.3. I'm fairly newbie in applescript
    I would like to select a user playlist, say called 'Jazz', that is built by myself, and change it as the source in iTunes DJ. With Apple script.
    So far I have managed changing the iTunes window to ITunes DJ by:
    *tell application "iTunes"*
    * set dj_playlist to some playlist whose special kind is Party Shuffle*
    * -- ...and the source playlist for Jazz*
    *-- ??? HERE*
    *end tell*
    Is it possible? any help would appreciated. Thanks.
    Indy

    No it isn't possible via the Apple TV 2, sorry.

  • User Playlists at iTunes Store

    What happened to the user playlists that were once available at the iTunes store? The were fun to browse and get download ideas from. Am I missing them or have they been removed?
    24" iMac Core Duo 2   Mac OS X (10.4.8)  

    Whoops, what I was referring to was iMixes. I found them...they sure are not easy to get to!

  • Multiple itune users on the same computer

    Is it possible to have two seperate itunes running on the same computer? My husband and I share a computer and both have ipods. We both have different tastes in music so we would like to be able to access our own itunes instead of having to share a library with all the music together.
    He currently has itunes set up with all his music on the computer at home. I have been running my itunes at work and would like to be able to bring my stuff home. Is this possible?

    When the iPods belong to different people, there are basically three ways of using multiple iPods on a computer and these involve:
    a) Sharing a single iTunes library
    b) Creating Multiple Libraries in a single user account
    c) Creating multiple user accounts.
    Note: When you are sharing an iTunes library, you don't have to set each iPod to update in the same manner, you can mix and match from the options below as each iPod has it's own update settings
    Sharing a Library and/or User Account
    If you want to share the one library, you can set either or all of the iPods so that they only get updated with only certain playlists (you can update from more than one if you wish): iPod - Syncing Music
    Choosing the update option "Sync Music - Selected playlists" allows you to create a playlist specifically for the iPod and drag the tracks you want into it. If you tire of the list and want to change it, you just add or remove the songs you don't want. The ones you take out out remain in the library to be used some other time if you choose. You can read more about playlists at these links:
    iTunes: Creating playlists of your favorite songs
    How to create a Smart Playlist with iTunes
    Or you can choose to update any or all of the iPods manually and just drag whatever content you want to them: Managing content manually on iPod
    Loading the iPod shuffle differs slightly but it can still be used with the others, for details have a look at this page: Adding songs to iPod shuffle - Windows
    Multiple Libraries
    It's also possible to have multiple libraries in a single account. To create or access a second (or more) library, hold down the Option key (or Shift key in Windows) when launching iTunes 7. In the resulting dialogue you will get the option to create a new library or navigate to the other Library.
    Note: You can only have one Library open at a time and iTunes will default to the last library opened if you don't use the keyboard command to choose one. This can prove tricky when using multiple iPods, if you don't use the keyboard command you can risk syncing to the wrong library: Using multiple iTunes libraries -Windows
    Separate User Accounts
    Another option is to create a separate User account for each person on your PC or Mac. Different accounts by definition would give you completely separate libraries. Each account has it's own iTunes folder, Library and iTunes Music folder and you load it with CDs etc just as you did with your original one. The iPod can be set to update however the owner chooses, sync all, manual or sync specific playlists
    I don't use Windows so I can't give you a step by step on that one, however I can point you to another web page which should help you out. You can read about Windows user accounts here:
    Using Windows XP User Accounts

  • My itunes library/playlist has gone after i compressed the music folder unaware of flow on effect.

    Please hekp me reinstate my itunes library and playlists after my attempt to compress the windows music folder to save hard disk space. I have gone back to the music folder and unchecked the compression box and it looks like the music is reapperaing in itunes but none of the playlists, purchased music or apps have appeared. This is very frustrating aspent hours cleanin up unplayed music , old playlists the kids had done and recently purchased a substantial amount of music. I had synced the recent playlisst to my iphone yesterday and am loath to do another sync incase itunes wipes playlists from my iphone. Cn someone please help.

    You can do a reverse sync to get playlists from your iPhone to your computer. This user tip should help you with this...
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • ITunes smart playlists MISSING!!

    This is so annoying!! My recetly added playlist (and also all other smart playlists) disappeared on both my iPad 2 and iPhone 4S all of a sudden when I synchronized them.
    I have tried unchecking the live update button of the playlist and then synchronizing my iPhone 4S again but it doesn't work. Could someone please please tell me how to fix it?
    B.T.W.  This seems a long lasting headache for many iTunes users, I hope Apple won't be so self-sufficient to lose insights about our concerns.

    Doublechecking. Do you still get the issue if you update to iTunes 10.6.3.25?
    From the notes for the release:
    Addresses a problem where iTunes may become unresponsive when syncing an iPad (1st generation) that contains an iBooks textbook
    Fixes a problem where photos synced to a device may appear in an unexpected order
    Resolves an issue where iTunes may unexpectedly delete playlists created on a device
    Fixes issues where iTunes may unexpectedly delete apps on a device
    http://www.apple.com/itunes/download/

  • Converting WinAmp (M3U) Playlists Into iTunes (XML) Playlists

    Hi. I was wondering if someone could help me out with suggestions on converting my old WinAmp (.m3u) playlists into usable iTunes (.xml) playlists?
    I have Windows XP Pro (with the latest Windows updates), and a brand new iPod 160 Gig Classic.
    I have used WinAmp as my media player for the longest time. The reason that I haven't created playlists in iTunes is because:
    It took me years to customize these Winamp playlists exactly how I want them (you know how that is).
    iTunes is a huge program that tends to takes up too many system resources on my PC. I have an older PC, and don't have the time or money to invest in a new system, copy files, set it up, etc.
    iTunes somehow modifies an mp3 whenever it is played in iTunes ( I can see that it has been modified in the "Date Modified" column, where my mp3 files are located).
    Historically - up until the last year or so, iTunes has not had too much of a problem faithfully importing my Winamp playlists into iTunes (to be transferred onto my iPod).
    So, I just got off the phone with Apple Technical Support, Tier 2.  I told him that I had the latest version of iTunes (version 10), installed yesterday.
    I successfully imported my 90 Gigs of mp3's into the  iTunes "Music Library" without a problem.
    The problem arose today when I tried to import one of my WinAmp (.m3u) playlists into iTunes, so that I could copy the playlist over onto my iPod. I've done this dozens of times. I've already tried uninstalling and then reinstalling iTunes.
    Like I said, I really want to keep these playlists it took a long time to customize the occurrence and frequency of favorite mp3's into those playlists.
    The technician said that the latest release of iTunes won't work with Winamp (m3u) playlists.  I asked him if he thought it would work again if I downloaded an older version of iTunes. He said that with the new iPod Classic that I have, it will not work with older versions of iTunes (I have no idea why), so that's out. He suggested Googling an "m3u to xml file converter."
    I checked on Google and saw a lot of programs that will convert xml files to m3u file format (for reasons unknown to me), but I haven't had any luck online finding a file converter that will faithfully convert my WinAmp (.m3u) playlists TO iTunes (.xml) playlists to use instead, and make iTunes run smoother. Any suggestions?*
    * Keep in mind that I'd really prefer to convert my m3u playlists, rather than create all new iTunes playlists from scratch.
    Thanks.

    solgar wrote:
    Tried the plug-in with Apple Technical Support. This WinAmp plug-in unfortunately does absolutely nothing.
    I went back an read some of the comments and it sounds like it only works with older versions of WinAmp.
    Try this http://www.topdownloads.net/software/m3u-to-xml-xspf-converter_2_39472.html
    or this python script http://users.musicbrainz.org/~matt/xspf/m3u2xspf
    or http://www.softpedia.com/get/Multimedia/Audio/Audio-Convertors/M3UtoXSPF.shtml
    Not sure this one will work since it is looking like the latest iTunes no longer supports m3u file sbut worth a try see http://www.burroak.on.ca/m3u2itunes.html

  • ITunes Store preferences in iTunes-create playlists

    In the preferences for the iTunes Store, there is an option to automatically create playlists when buying song collections. How does this work? I don't ever see iTunes create a playlist when I buy songs/albums.

    Turning off the option - I doubt - will change the 'Purchases' list. I have it 'off' in my prefs and I still have all iTS purchases added to the 'Purchases' list.
    From the iTunes Help menu and a search for "song collection": <You can set iTunes to automatically create playlists when you buy collections from the iTunes Store, such as iMixes, submitted by iTunes users; and iTunes Essentials, favorites chosen by an iTunes Store staff of experts.>
    MJ

  • Alphabetizing different between iTunes Library & Playlists ?

    The alphabetizing different between iTunes Library & Playlists appears to be different, for example, look how The ... bands are listed between the two.
    Am I seeing this right? If so, is there a setting to correct it ?
    Should they alphabitze the same way so everything matches ?
    Should Apple correct this ?
    thanks,
    tnixer

    txchain wrote:
    I'm trying to keep the focus on the functionality of the program.
    Cross referencing is almost inherit to any developed program like iTunes.
    There are two features to this program that Alphabetize differently.
    Should Apple correct this if it is true ?
    They're different kinds of data. Songs are tagged with artist names and so on, and iTunes uses that data to organize your music like a library, using library alphabetization — i.e., ignoring articles. Playlists are user-defined categories, for which library alphabetization is less obviously appropriate. They're not cross-referenced — they have no connection to each other unless the user creates one.
    If the organization of that data matched, from one function to another, the program could cross reference (and list them) with no contradiction.
    Maybe it's why playlists slow down the music library?
    Having hundreds of playlists will slow down iTunes because iTunes frequently needs to "look through" your list of playlists — when creating smart playlists, for instance, or when you control-click on a song and see "Show in Playlist" in the contextual menu. A couple dozen playlists won't slow things down at all, but iTunes isn't really designed to work well with hundreds. It really has nothing to do with your playlists not matching your tags; the two kinds of data are entirely separate within iTunes.

  • I have set up a second iTunes user account on my PC, but when I create the new iTunes account it copies the music, videos etc from the original account and they seem to be linked.  What am I doing wrong?

    I have set up a second iTunes user account on my PC, but when I create the new iTunes account it copies the music, videos etc from the original account and they seem to be linked, so that when I delete a song from one library it deletes from the other one. 
    On the online tutorials I've seen it shows that when you create a new iTunes library it should open as a blank account, but that isn't happening.
    What am I doing wrong?

    If you  have iTunes 11 turn on the Sidebar. Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar. The sidebar is where Devices appears. and Control+B to show the Menu bar
    If necessary:
    iOS: Device not recognized in iTunes for Windows
    or
    iOS: Device not recognized in iTunes for Mac OS X

  • HT1660 I HAVE 2 ITUNES USER`S ID HOW CAN I MERGE THEM, IF SO?

    I HAVE 2 ITUNES USER`S ID HOW CAN I MERGE THEM, IF SO?

    Sorry you cannot...
    From Here   http://support.apple.com/kb/HE37
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.

  • My macbook pro logic board died. I had all my music on an external drive. How do I get my iTunes library, playlists etc. from my dead computer onto my new one?

    My logic board died on my old macbook pro. I have a new one, but I want to get my iTunes library off my old hard drive and put it on my new one. I had set up my old MBP to store all my iTunes music on an external drive, so I have the music. The iTunes program was on the old MBP hard drive.How do I essentially recreate my previous iTunes library, playlists, etc on my new laptop?

    You will need the iTunes Library.itl file which generally lives in ~/Music/iTunes/. You can recover this from the backups you were making before the HDD died. Otherwise, you cannot recreate the library.

  • I am a long time iTunes user but a new MacBook owner! :) I keep the majority of my music files on an external hard drive.   I'm trying to view all those files on my MacBook through iTunes.   With windows you would go to : File/Add To Library, and iTunes w

    I am a long time iTunes user but a new MacBook owner! I keep the majority of my music files on an external hard drive.   I'm trying to view all those files on my MacBook through iTunes.   With windows you would go to : File/Add To Library, and iTunes would add all your selected files to your music library BUT WOULD NOT COPY THEM TO YOUR HARD DRIVE.  In other words, if the external hard drive was connected, you could listen, drag/drop, and edit the files.   When I tried the same thing with my new MacBook... it actually started coping the files to my MacBook harddrive.  I don't want that, it's millions and millions of mp3's that I don't want to keep on my computer, only my external hard drive.   Can anyone help?    I'm sure it's something easy, I'm just so new to the Mac world.   Being an iPhone owner for many many years I'm picking up things fast, but this is getting the best of me!  Help !

    In iTunes 11 uncheck the preferences setting in in the iTunes Preferences panel "Advanced > Copy Files to iTunes Media folder when adding to Library"

Maybe you are looking for