Take the 2-minute tour ×

The question is in the title :) I'm playing a bit with Objective-C and Scripting Bridge. I know it is possible to get information (readonly) from iTunes, but i see nowhere a way to modify a track, for exemple change its name. Is it possible with this or another technology ?

Thanks a lot :)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Well, from the Scripting Library in AppleScript Editor, I can see that a file_track inherits from item and an item has the read-write property name. So you should be able to set it just as easily as you can read it.

Edit: Actually, almost every piece of meta-data is part of track (of which file_track inherits aswell) and most are read-write properties...

Doug Adams has one such script which can change titles from song in iTunes. Maybe have a look at it?

As for setting it via Objective-C, perhaps this documention can help you.

Exerpt from the website:

Listing 2-3 Setting the locked property of Finder items

   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 
   FinderApplication *theFinder = [SBApplication applicationWithBundleIdentifier: @"com.apple.finder"]; 
   SBElementArray *trashItems = [[theFinder trash] items]; 
   if ([trashItems count] > 0) { 
       for (FinderItem *item in trashItems) { 
           if ([item locked]==YES) 
               [item setLocked:NO];          // <<<-- Setting the property
   [pool drain]; 
   return 0; 

Have you tried:

iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]; 
[[iTunes currentTrack] setName:@"The New Song Title"]); 
share|improve this answer
Okay thanks, i'm gonna look at that. I got confused because of the keyword copy with property declaration in the iTunes.h file. In fact it will work, hope so ! –  getmax0 May 4 '12 at 14:38
Don't forget to accept the answer if it solved your question. :) –  Qwerty Bob May 4 '12 at 14:42
Wow okay that's awesome :) i'm really really really new to this though –  getmax0 May 4 '12 at 14:42
note: since currentTrack and name are properties you can use the property syntax: iTunes.currentTrack.name = @"The New Song Title"; –  geowar May 8 '13 at 15:31
add comment

Your Answer


