Ok, so after some research on Scripting Bridge, just like Andrew Madsen suggested. Here is the answer to my own question.
This has been implemented and tested...
- Add the ScriptingBridge Framework to your Mac OS Project.
Generate the iTunes.h file by writing the following in the terminal.
sdef /Applications/iTunes.app | sdp -fh --basename iTunes
Import the newly created iTunes.h file into your Mac OS Project and do an #import "iTunes.h" in the class you would like to use the Scripting Bridge in.
Use this code to add a song to iTunes:
iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]; iTunesTrack * track = [iTunes add:[NSArray arrayWithObject:[NSURL fileURLWithPath:filePath]] to:playlist];
That is all to it.