Sign in to follow this  
Followers 0
Decker87

adding tracks with iTunes

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



I think I know the problem, could I see your whole code?

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0