Jump to content

iTunes interfacing


Recommended Posts

I've looked through the documentation but can't find anywhere how to get the title of the currently selected tracks.

If anybody could get me a little script that makes me an array of all selected tracks that would be awesome I'd be very grateful. Any other advice would also be great

Link to comment
Share on other sites

I don't have iTunes, because I don't have an iPod, because I don't buy DRM, because that's just plain retarded, so i can't test this:

#include <Array.au3>
Dim $aSelTracks[1]
$iTunesApp = ObjCreate("iTunes.Application")
for $track in $iTunesApp.SelectedTracks
    _ArrayAdd($aSelTracks,$track.Location)
    $aSelTracks[0] = Ubound($aSelTracks)
Next
_ArrayDisplay ($aSelTracks, "Selected Tracks" )
Edit: sorry, you said you wanted it in an array, so I modified it.

Edited by lod3n

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

I don't have iTunes, because I don't have an iPod, because I don't buy DRM, because that's just plain retarded, so i can't test this:

#include <Array.au3>
Dim $aSelTracks[1]
$iTunesApp = ObjCreate("iTunes.Application")
for $track in $iTunesApp.SelectedTracks
    _ArrayAdd($aSelTracks,$track.Location)
    $aSelTracks[0] = Ubound($aSelTracks)
Next
_ArrayDisplay ($aSelTracks, "Selected Tracks" )
Edit: sorry, you said you wanted it in an array, so I modified it.

Well thanks a lot for helping me out with that. I'll test it out later and it looks good to me.

Sorry im not that good with autoit even though I've known it for over a year now.

Hope I can return the favour somehow someday

Edited by yaziquex
Link to comment
Share on other sites

Just to clarify...

I haven't actually tested yet, but from the script I understand that when you create the object $track gains some value automatically? And that because you used .Location you're giving me the location of each song?

I'll just have to test it I guess...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...