How to change iTunes artist name with AS

I know this is not working anymore


tellapplication"iTunes"

tell itunes_track_name

set artist to PublisherName

set name to TrackName

end tell

end tell


But I need to change artist name.


Thanks in advance

MacBook Pro with Retina display, OS X Mountain Lion (10.8.4)

Posted on Aug 6, 2013 7:22 AM

Reply
10 replies

Aug 10, 2013 7:03 AM in response to deniz343

You need to tell iTunes what the item is by specifying it in its terms, for example a track of a user playlist or an item of the current selection. If you are using an existing name, you can get a specifier by having iTunes look it up, for example:


setsongNameto"testing"


tellapplication"iTunes"


settheTrackstotracksofplaylist"Library"whosenameissongName-- look it up in master library


iftheTracksisnot {} thentellfirstitemoftheTracks-- just one, if it exists

setartistto ("X " & artist) -- just add a prefix for texting

setnameto ("Z " & name) -- just add a prefix for testing


endtell

endtell

Aug 17, 2013 7:21 AM in response to deniz343

Apple has made a lot of information about their technolgies available on the internet (with local documentation sets in Xcode, if you are using that application). The AppleScript Language Guide for example, documents the commands and syntax of the AppleScript language, and additional terms and commands available in the various scriptable applications can be seen by opening their scripting dictionaries in the AppleScript Editor. Cocoa is a different beast, with even more documentation, and also uses a different programming language (although the various methods can be used via Cocoa-AppleScript) - the items in the Application Kit Framework Reference are just a start, for example.


It does take a little while to figure out the way things are organized and how they relate to each other - and a little while longer if you are just starting out and these kinds of things are new to you. And yes, it has been a very long time since 1978.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to change iTunes artist name with AS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.