Jump to content

adding tracks with iTunes


Decker87
 Share

Recommended Posts

I am using the iTunes UDF. I need to add files to my iTunes library. However, when I use the function _iTunes_Library_AddTrack("C:\test\primus.mp3") it spits out an error message on line 114 of iTunes.au3:

C:\Program Files\AutoIt3\Include\itunes.au3 (114) : ==> The requested action with this object has failed.:
$Library_Playlist.AddTrack($path)
$Library_Playlist.AddTrack($path)^ ERROR
->11:39:31 AutoIT3.exe ended.rc:1

So how can I add a file to my iTunes library?

Edited by Decker87
Link to comment
Share on other sites

just add _iTunes_Start() at the beginning of the code :mellow:

cheers

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

I wish it were that easy. Yes, I used _iTunes_Start() in my code beforehand.

However, I did manage to do what I wanted. Turns out .AddFile is the method I wanted. So, I added this to iTunes.au3:

Func _iTunes_Library_AddFile($path)
    $Library_Playlist.AddFile($path)
EndFunc

Which works great. Now the question is - how can I retrieve this newly added track as an object? For instance, say I want to add the song "Changes" by "2pac" and automatically change the artist to "Tupac". I understand how to set the artist of a song that is already playing by using CurrentTrack().

Edited by Decker87
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...