Selecting tracks in iTunes

When I do a search for this, it just turns up a million scripts where you first select a track, then run the script... but what I need is for the applescript itself to select a certain track, such as when you select a file in the Finder by saying select file 'that.jpg' of folder 'this'
Is this possible?
G5   Mac OS X (10.4.8)  

Maybe this helps?:
tell application "iTunes"
set theTrack to every track of library playlist "Library" whose name is "A New Day Yesterday" and artist is "Jethro Tull"
if (count of theTrack) > 1 then
--there's more than one track that meets the search criteria
else if (count of theTrack) is 1 then
set theTrack to theTrack as reference
else
--you got no tracks that meet the search criteria
end if
end tell
==>file track id 7760 of library playlist id 6868 of source id 49 of application "iTunes"
then you can perform whatever action upon theTrack.

Similar Messages

  • How to view ALL selected tracks in iTunes

    Simple question, I hope, but I've got more tracks on my iTunes than I can fit into my iPhone and I would like to be able to see how much memory my selected tracks take up, in total, not just by artist, before I try to sync.
    Is there anyway of viewing all selected tracks in iTunes?

    Create a new playlist using the command File > New Playlist. Drag the selected tracks into it. Open the playlist and look at the bottom to see the number of tracks, total size, and playing time.

  • How do I select multiple tracks in iTunes?

    It's like a hold down control and something else, and then drag the curser to select the songs you want selected. I'm not sure what this shortcut is. Again, I want to select multiple tracks on iTunes so I can move files or delete them. Simply selecting all won't work because the files are different names. Anyone know this shortcut? Thanks!

    If you click a track, hold down shift, and then click another one, it will select all the tracks between those two. Holding down command (the apple key) will allow you to select/deselect individual tracks.

  • Cannot select tracks on ipod classics through Itunes.

    Hi
    Once I connect my new IPOD to my mac, the IPOD itself shows up and the list of music on the IPOD shows up in ITunes, but I edit/select tracks at all. Its as if they are locked. Any idea how to overcome this?

    If the songs are "greyed out" it's because you have the iPod set to transfer songs automatically. That is also why the padlock icon appears at the bottom of iTunes next to the space used/available.
    If you want the songs to be bold and selectable/editable, then you need to change to manage the content manually.
    Please note that by editing/changing the songs on your iPod in this manner, the changes will not affect the songs in iTunes, only on your iPod.

  • Itunes Play Selected Track

    Ok so I'm a beginner at this but dougs apple script to play the selected song next doesn't work on my mac anyway so i started playing about writing my own, I'm not quite sure what I'm doing wrong for it not the play the song. Any help would be great? Heres what I have cheers :-
    on run
    tell application "iTunes"
    activate
    if player state is playing and selection of front window is not {} and (count items of selection of front window) is 1 then
    set seltrack to selection of front window
    else
    --exit
    end if
    set founded to false
    repeat while founded is false
    set finished to (finish of current track)
    set curent to player position
    if (round curent) is equal to (round finished rounding down) then
    play seltrack
    set founded to true
    end if
    end repeat
    end tell
    end run

    Hi,
    Thank you for the advice so far, like i said I'm totally new to this so it is really helpful. I am trying to get Itunes to play the song which is selected at the point of opening the applescript one the song currently playing finishes. Here a code I have altered after Camelot's reply.
    on run
    tell application "iTunes"
    activate
    if player state is playing and selection of front window is not {} and (count items of selection of front window) is 1 then
    set seltrack to selection of front window
    set finished to (finish of current track)
    else
    tell me to quit
    end if
    set founded to false
    repeat while founded is false
    set curent to player position
    if (round curent) is equal to (round finished rounding down) then
    play seltrack
    set founded to true
    end if
    end repeat
    end tell
    end run
    When running in the applescript editor it seems to get the end time for the track and keep refreshing the player position but when the two are equal and the song should play this error appears
    "Itunes got an error: Can't make some data into expected type." While this message is displayed it hi lights the line. In the replies section it sates the error also with "number -1700 to item" on the end.
    play seltrack
    I have also tried pasting all the statements into the initial if statement like this
    on run
    tell application "iTunes"
    activate
    if player state is playing and selection of front window is not {} and (count items of selection of front window) is 1 then
    set seltrack to selection of front window
    set finished to (finish of current track)
    set founded to false
    repeat while founded is false
    set curent to player position
    if (round curent) is equal to (round finished rounding down) then
    play seltrack
    set founded to true
    end if
    end repeat
    else
    tell me to quit
    end if
    end tell
    end run
    But i still get the same error. Would it be something to do with the way the script imports the selection details and itunes not recognising it maybe?
    Message was edited by: JDeere

  • I do not have an option to join tracks in Itunes 11.2.2.3. My options button has only two choices after selecting multiple tracks.

    I do not have an option to join tracks in Itunes 11.2.2.3. My options button has only two choices after selecting multiple tracks - get track names and submit cd track names. How do I join multiple tracks into one?

    Weird, works for me.
    tt2

  • "Delete Selected Track Files" Applescript script fails for iTunes 7

    The Delete Selected Track Files script, which is found on the Apple site http://www.apple.com/applescript/itunes/, fails with a error message of "iTunes got an error: file track id 42130 of user playlist id 30791 of source id 40 doesn't understand the delete message." The message is the same regardless of which song(s) I try to delete. Does anyone know how to update the script or know of a workaround?

    Found my mistake. I was testing the script by playing a track from a shared iTunes library across my local net. As soon as I played a track residing on the local machine itself the script worked in iTunes 8.0 as it worked before on iTunes 7.x
    Apparently I'll need to code for the case of a shared track in order to correctly resolve the alias to the file track on the remote machine.
    Thanks Niel!

  • How can I get 2 different track from iTunes playing on 2 different stereos?

    We are remodeling a part of our home and decided that this would be the time to install a whole house audio system. We would like to use our iTunes library as a source and be able to play different tracks in different parts of the house (also called zones)
    To put it in a slightly different fashion. I could have a dedicated Mac Mini with my iTunes library and it would feed tracks with meta data to 3 stereos in various parts of the house. Each stereo independently select tracks or playlists.
    iTunes purchased tracks need to work as well.
    Thank you all....

    What you need is to use one Mac (or PC) as a server (and storing all the music) and then one of the following in each room connected to that rooms HiFi system.
    Sonos ZonePlayer see http://www.sonos.com this is the most expensive option but is regarded as the premier multi-room solution.
    Roku SoundBridge see http://www.rokulabs.com (I have three M2000 SoundBridges myself)
    Slim Devices Squeezebox see http://www.slimdevices.com
    Apple TV see http://www.apple.com/appletv (unlike all the above this will require the use of a TV)
    With these, different rooms can play different tracks at the same time with them all stored on the single computer.

  • Multiple versions of audio tracks in iTunes

    I updated the ATV to "take 2" with no problems.
    However the new data model of seamlessly splicing together the data on the ATV and in the iTunes library on the synced-from computer has bit me on the posterior. The problem is that I have 3 versions of each CD "cut" in my main iTunes library --
    1) Apple Lossless (ripped from CD) for the main machine,
    2) 128K AAC synced to the ATV and copied to my laptop,
    3) 64K MP3 mono (i.e. 32K effective) synced to my iPhone.
    The "Music" list shows all 3 tracks. I manage this with smart playlists that select based on the encoding bitrate. To play music on the main machine I look at and play from my "bitrate_high" playlist. I sync the "bitrate_128" list to the ATV and the "bitrate_low" to the iPhone.
    After the ATV 2 update if the main machine is awake and iTunes is running, which is what you
    want for video, I see all 3 tracks in the music section. Select an album and it shows, and plays,
    all 3 versions of each track. If you try to use playlists the selection mechanism in iTunes isn't
    present -- i.e. you only see a list of tracks in the playlist and can't select based on artist or
    album. My current solution is to sleep the main machine if I want to listen to music on the ATV.
    That works, but is fundamentally broken.
    Not syncing to the ATV and streaming from the main machine won't help -- the ATV will still see all the versions of each cut.
    Am I missing some way not to "splice" the content from the synced-from iTunes library for music?
    I'm perfectly willing to complain about this in a productive way to Apple, but I thought I'd see if anybody here had an illuminating or helpful comment or suggestion.
    I like the ATV. I like that it is simple. But maybe it is either a bit too simple or depends on iTunes which has some fundamental conceptual flaws in a world with many sorts of devices that are synced with a single library.

    You're welcome.
    tt2

  • How do i rename tracks in itunes in a imac?

    am new imac owner, previously had a PC and used right-click to rename tracks where itunes wasn't able to get track details when uploading CD's - how do i do this on the imac?  also how do i get album art work?  please don't judge me for ignorance Apple lovers......i have seen the light, i have converted, i just need a little help.....

    You can use Get Info for a selected song - with a song selected at the iTunes menu bar go to File and select Get Info - the keyboard shortcut for this will be available next to the Get Info selection.
    iTunes includes an option to check for album artwork for songs that don't have it, or search the web and download your own which can be added via the Get Info function for a selected song. The last tab for the various selections is the artwork - it can be added there.

  • Can I set a track from iTunes as my ringtone?

    Can I set a track from iTunes as my ringtone?

    You can make a ringtone out of a song that:
    1) is or was purchased from itunes
    2) has a ringtone icon
    Once you have the itunes purchased song in your library and it has the bell icon, then click on the bell icon. Then edit the song to the portion and length of the clip you want to use.
    Then select buy( it will cost 99 cents in addition to the original cost of purchasing the song from itunes). It will show up in your ringtones heading in itunes. When you sync, it will be on your iphone.

  • Renaming Finder´s tracks from iTunes

    Situation:
    I have a folder in Finder with all my songs but these are not renamed properly... it came like this, when i burned the CD into my hard disk:
    Example:
    "09-jump" (which means - Track: nº9 / Title: Jump / Author: Madonna)
    Question:
    After doing a "import folder" into iTunes, i renamed all my 450 tracks in the Song-column and in the Author-column, but that didnt change my original files inside Finder... I do not want to go trought renaming again, so how do i save time and replace the renamed tracks from iTunes into the Finder folder? (i´ve tried draging it out in order to do a "replace" action, but the selected tracks wont move outside iTunes).

    Look at Edit > Preferences > Advanced and see if you have checked the box for "Keep iTunes Media Folder organized." If so, iTunes will "organize" the file to its new location.

  • I can't change the name of the track in iTunes on my iMac OSX10

    I can't change the name of the track in iTunes on my iMac ox10 . I tried the iTune's Help & read a few answers on this site , but none seems to be working . I  go to Info & & press Ok & the name changes in itune , but when I enter the same track to itune again, I get the old name back again. I have no problen in widows7 , I either go to info or I just highlight the track & copy paste the name I want , but I can't do the the same on mac.
    Pls help
    Thanks

    Go to \Music\ abnd find the iTunes folder.
    Right click - Properties.
    Make sure it is not Read Only.
    Also, make sure you have full *Read/Writes permissions* to the iTunes folder and all contents.
    Select the \Music\iTunes\ folder and see this -> http://paulstamatiou.com/how-to-quickie-vista-permissions

  • Can't delete metadata for multiple tracks in iTunes 12

    Hi. I have about 20 tracks in iTunes and I want to delete the metadata on all of them at once, something I've done a thousand times on prior versions of iTunes. I select the tracks, hit Apple-I, and make global changes, i.e. deleting all the track numbers or clearing out the composer box, etc. But now, it's not happening. I click into the box, hit Delete, the grey dash will disappear, but when I go to another box, the dash returns and when I leave the Info dialog, the boxes aren't empty.
    However, when I do the same thing to the tracks individually, it works.
    Is there an extra step that I'm missing, one that's new to iTunes 12?
    Thx!

    Same issue.  The error says not enough space for me -- go to settings to alter. Takes me to storage -- and the video is not listed as using storage!
    I have 8 episodes stuck there -- some even play -- but none will swipe to delete.  To test I did swipe to delete a video podcast -- no problem.  Just my TV Shows seem to be permanent fixtures.
    Connected to the computer to see what ITunes showed as installed TV Shows on the device -- nothing there...!!!

  • Ipod touch (5th generation) won't sync all selected music in itunes.

    ipod touch (5th generation) won't sync all selected music in itunes version 12.0.1.  Under the summary tab, I've selected "Sync only checked songs and videos."  In the music tab, I've selected the various albums and artists I want.  I click on "sync," and some albums sync, others do not.  Often, only some tracks of the selected albums sync.  Additionally, some albums sync that I haven't even selected.  My computer's operating system is Windows 8.1.  Please help - thank you!

    Providing the songs play OK in iTunes on the computer and you do not have any Restrictions set that wold prevent syncing those songs (Settings>General>Restrictions; iTunes purchases only)
    Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync/delete all music and resync
    To delete all music go to Settings>General>Usage>Storage>Music>Tap edit in upper right and then tap the minus sign by All Music
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

Maybe you are looking for