Applescript to reverse names for Sort Artist

Does anyone know of an Applescript to use in iTunes to take the Artist, reverse the names and put the result into the Sort Artist field? In other words, if the Artist is "Elvis Presley", it would automatically assign "Presley, Elvis" to the Sort Artist field.
I have checked on Doug's Applescripts site, but couldn't find this function.
Thanks!

I've also been looking for the answer to this question. Have you figured out if there's a way to do it?
I don't want to have to edit each and every song entry - I want iTunes to automatically sort "Joel, Bill" instead of "Billy Joel."
Anyone have any info?

Similar Messages

  • Artist for sorting issues

    Hi,
    I have more and more Asian artists on my iTunes player and for the accuracy of last fm scrobbling I'm using the Asian alphabets, but as I can't read (and memorize) Asian alphabets I use the romanized equivalents in the "for sorting" ("pour le tri" in French) fields, BUT we can't enter an artist name for sorting for several tracks at the same time like we can for the artist and title fields, that's a big issue, so for now I use the "artist of the album" instead of "artist for sorting", do Apple plan to fix the limited use of the "for sorting" feature?
    Best.

    There is a way of entering sort fields on multiple tracks.
    First enter and save the information in one track and save it.
    The select the track and right click, you will discover an apply sort field option which gives several ways of adding the sort field to other tracks.
    Message was edited by: polydorus

  • About 'Sort Artist' name

    Hi
    i am trying to find out,
    as some of my songs' "sort artist" is grey in color (instead of black),
    and if the "sort artist" content word is grey in color, it will automatically sort songs with same ARTIST name to have the same "sort artist" name.
    EG: if the ARTIST name is The Pussycat Dolls, and the "sort artist" name is Pussycat Dolls (grey in color instead of black), all songs ARTIST name with 'The Pussycat Dolls' will automatically change the "sort artist" name to Pussycat Dolls.
    EG: if the ARTIST name is The Pussycat Dolls, and the "sort artist" name is Pussycat Dolls (black in color), all songs ARTIST name with 'The Pussycat Dolls' will not automatically change the "sort artist" name to Pussycat Dolls.
    May I know how to set the "sort artist" name to become grey color so that it will automatically change the "sort artist" name for all ARTIST with the same name?
    Anyone's soonest help will be appreciated.
    Thank you
    Grace Tang

    Further to my question, when I plug in and select my iPad 2 I don't have the same problem.  I have restored the settings on my iPod Touch and updated both iTunes and iPod Touch software and restarted my iPod touch.  Nothing has made any difference.

  • "Sort Artist" does not work on iPod / How to sort by album artist

    I have many albums in my music collection that contain songs by different artists. In iTunes, I have set all these songs to the same "Sort Artist" so that they all appear under the same artist's name (the album artist's name).
    However, when I sync my iPod, the "Sort Artist" settings don't carry over. For example, a compilation album with 10 songs by 10 different artists would show up under one single artist in iTunes (per my sort artist settings), but on the iPod the songs show up under 10 different artists. Is there any way to fix this problem? I basically want to sort my music by album artist, instead of just the artist.
    The strange part is when I browse my iPod on my computer, the compilation albums are properly sorted under one artist, but it's still wrong when I browse on the iPod itself.

    It could be that you have inadvertently imported these CDs into iTunes as part of a compilation. If so, the artists won't show in the artists menu on the iPod.
    To check, highlight the tracks on one of the offending artists CDs in iTunes, right click and select "get info". This brings up a multiple song info window, and from there you can check if you have 'yes' in the box marked "part of a compilation".
    If you have, select 'no' instead and click 'ok'. Do this with any CD that has this issue. This will alter the info in iTunes, and you should then connect your iPod and synchronize the changes.
    The problem arises because the information contained on the Gracenote CD Data Base (where iTunes gets all it's album/artist/track info from), is sometimes incorrect. It can show CDs as compilations when in fact they are not.
    You should also check that the songs have album name info in their ID tags.
    See: Some songs don't show under artist on my iPod.
    Once you add a second album name for that artist even for a single song, ALL the rest of the songs should now show up under that artist, even those without album names.
    Providing the spelling for the artists is exactly the same of course.

  • Multiple listings for one artist on iPod

    What, if there is one, the easiest way to consolidate all of one artist's music into one group for that artist.I noticed that whenever I scroll through my artist list on my iPod it will show up to six names for one artist when that is the only artist on each album...I've tried listing the name in the sort album and sort artist but it still seems not to change anything.

    Create a playlist
    Put all affected tracks into it
    Select all tracks on that list
    Press Apple-I on your keyboard
    Enter the correct name as "Artist"
    Press 'OK'

  • Help with a simple applescript for combining Artist text with Track name

    Hi all,
    I'd like to put together a simple script that takes the artist names from a list of tracks in iTunes and copies the text to the start of the Title name, followed by " - ".
    This is because, e.g. on a classical album, I want the artist names to all be "Classic Collection Gold" but I'd like to keep the artist name contained with the track name. This means when I browse by artist I don't get millions of artists...
    I found this script, which does something kinda similar, but I'm new to script writing so not sure how to do it?
    So I'd like to change:
    Name
    Planets: Mars
    Artist
    Gustav Holst
    Ambum:
    Simply Classical Gold (Disc 2)
    To be:
    Gustav Holst - Planets: Mars
    Artist
    Gustav Holst - Planets: Mars OR BETTER Simply Classical Gold (Disc 2)
    Album
    Simply Classical Gold (Disc 2)
    This script has some ideas in, but I'm not sure how to tweak it....
    "Artist - Name Corrector" for iTunes
    written by Doug Adams
    [email protected]
    v1.6 May 17, 2004
    -- removed ref to selection
    v1.5 April 11 2004
    checks if separator string is in name
    v1.0 April 2 2004
    Get more free AppleScripts and info on writing your own
    at Doug's AppleScripts for iTunes
    http://www.malcolmadams.com/itunes/
    property separator : " - "
    tell application "iTunes"
    if selection is not {} then
    set sel to selection
    repeat with aTrack in sel
    tell aTrack
    if (get name) contains separator then
    set {artist, name} to my texttolist(get name, separator)
    end if
    end tell
    end repeat
    end if
    end tell
    -- == == == == == == == == == == == == == == == ==
    on texttolist(txt, delim)
    set saveD to AppleScript's text item delimiters
    try
    set AppleScript's text item delimiters to {delim}
    set theList to every text item of txt
    on error errStr number errNum
    set AppleScript's text item delimiters to saveD
    error errStr number errNum
    end try
    set AppleScript's text item delimiters to saveD
    return (theList)
    end texttolist
    Message was edited by: Chipstix

    I'm not sure what that script thinks it's doing, but it's essentially doing nothing, so scrub that and start afresh.
    The first thing you need is a way to identify the tracks to change - you don't want to do all tracks in the library (they might have already been munged). A good option is to work on the selected tracks:
    tell application "iTunes"
    if selection is not {} then
    set sel to selection
    You then need to iterate through those items, changing them one-by-one:
    repeat with aTrack in sel
    Now comes the easy part - build a list of the elements you want (in this case you want the name, artist, and album of each track:
    set trackName to name of aTrack
    set trackArtist to artist of aTrack
    set trackAlbum to album of aTrack
    Now you have the information you need, so reset the fields as appropriate:
    set name of aTrack to trackArtist & " - " & trackName
    set artist of aTrack to trackAlbum -- or to trackArtist & " - " & trackName, depending on your choice
    Now clean up by closing off the repeat and tell blocks:
    end repeat
    end tell
    Putting it all together you get:
    tell application "iTunes"
      if selection is not {} then
      set sel to selection
      repeat with aTrack in sel
        set trackName to name of aTrack
        set trackArtist to artist of aTrack
        set trackAlbum to album of aTrack
        set name of aTrack to trackArtist & " - " & trackName
        set artist of aTrack to trackAlbum -- or to trackArtist & " - " & trackName, depending on your choice
      end repeat
    end tell

  • How can i bulk rename music files in reverse order from artist - song name to songname - artist

    How can I bulk rename music files in reverse order from artist - song name to songname - artist.
    I actually dont need to rename the actual files.
    Its just i have a huge txt list of 100,000 music names that are listed as so..
    Artist - Song Name
    Artist - Song Name
    Artist - Song Name
    Artist - Song Name
    Artist - Song Name
    Artist - Song Name
    and i need this list to reverse it self so it is listed in the list as
    Song Name - Artist
    Song Name - Artist
    Song Name - Artist
    Song Name - Artist
    Song Name - Artist
    Song Name - Artist
    Song Name - Artist
    Im sure there is some kinda way to auto a mix of applescript/automator/terminal to do something like:  all char before the "-" replace with the chars after the "-".
    Please some one help me if you know how I can pull this off

    How can I bulk rename music files in reverse order from artist - song name to songname - artist.
    I actually dont need to rename the actual files.
    Its just i have a huge txt list of 100,000 music names that are listed as so.
    I wonder if we haven't misunderstood what you were asking for. Could it be that you have not a huge file, but just a huge list of names in many small files. If that's the case, you should rather use the following script instead of the previous one.
    Since this script does not rename the files, make a backup of your files before running it.
    set theFolder to choose folder -- the folder containing your text files
    tell application "Finder"
        set theNames to name of files of theFolder whose name extension is "txt"
    end tell
    set theTextFiles to {}
    set theFolderPath to POSIX path of theFolder
    repeat with thisName in theNames
        copy theFolderPath & thisName to the end of theTextFiles
    end repeat
    repeat with thisFile in theTextFiles
        set F1 to open for access thisFile
        set theText to read F1
        close access F1
        set theParagraphs to paragraphs of theText
        set bigList to (a reference to theParagraphs)
        set theNewParagraphs to {}
        set bigNewList to (a reference to theNewParagraphs)
        repeat with X in bigList
            set P to offset of " - " in X
            if P = 0 then
                set Y to X
            else
                set Y to text (P + 3) through -1 of X & " - " & text 1 through (P - 1) of X
            end if
            copy Y & return to the end of bigNewList
        end repeat
        set theNewText to text 1 through -2 of (bigNewList as text)
        set F2 to open for access thisFile with write permission
        set eof F2 to 0
        write theNewText to F2
        close access F2
    end repeat
    display dialog "Done!" buttons {"OK"} default button 1 with icon 1
    Message was edited by: Pierre L.

  • Incorrect artist name for all songs by that artist

    Recently something weird has happened to my music library on my iPhone 5S (iOS 8.2 before, but I've updated to 8.3 and still the issue persists). All the songs by a particular artist have the artist name listed wrongly. For example, I have about 50 Katy Perry songs from her 3 albums, and all of them are listed as "Katy Perry & Snoop Dogg", which is, by the way, the artist name for ONLY California Gurls. Funny thing is, the artist names display correctly on iTunes on my MacBook Pro. I've checked the info for the songs, and the names are correct under both Details and Sorting. This happens for a few other artists as well.
    I've tried deleting the songs from my iPhone and re-syncing them back, still the same. I've tried changing the artist, album artist info for the songs, doesn't help. I've even re-synced my entire music library to my iPhone but that didn't work either.
    Probably a bug but is there a workaround or a fix for this?

    UPDATE!!!
    Turns out that deleting glitchy albums from the phone and then re-syncing via Home computer's iTunes worked!
    It just takes a bit longer to change over to the proper artist names!!!
    YAYY!!!!
    So deleting music from iPhone Music Library and then going into your home iTunes Library and re-syncing/adding it to your iphone or device while it is plugged in via USB!
    =]

  • Artist Name not sorting

    I'm having trouble when I import new artists into Itunes. Suddenly, if it's a new artist
    Itunes will sort it to the right genre list but won't list the artist. I tried "get info" for the
    cd and sorting by artist name but still nothing comes up.
    Any help?

    Hi, welcome to Apple Discussions.
    iTunes doesn't do multi-layered sorts, or rather it does sometimes, but as users we have no control over them. Take, for example, the *Album by Year* view and you'll see that is has sub-ordering on quite a few values. In pseudo-SQL it's something like this:
    SELECT * FROM Tracks ORDER BY Sort Album Artist, Year (Of 1st Track of Album), Sort Album, Disc #(Empties Last), Track #(Empties Last)
    Where there is no Sort Album Artist value it is infered from Album Artist, Sort Artist or Artist. Where there is no Sort Album it is infered from Album.
    When you click to sort on the Year column any previous ordering is discarded. If the tracks are in the wrong order then all you can do is click again to change between an ascending or descening sort.
    A quick look at my tracks sorted by Genre suggests as if the result is something like this:
    SELECT * FROM Tracks ORDER BY Genre, Sort Artist, Sort Album, Disc #(Empties Last), Track #(Empties Last)
    Again, it doesn't matter which columns you click before selecting Genre tere's nothing you can do to get the sort you're after. Personally I'd stick with Album by Artist (which is actually Album by Album Artist) and turn on the Genre in the Column Browser so that you can show all albums in a particular genre in a sensible order.
    For general tips on grouping & ordering tracks in iTunes see http://samsoft.org.uk/iTunes/grouping.asp
    tt2

  • Sorting "artist" by last name

    How do I sort artists by last name, i.e. Davis, Miles rather than Miles Davis?

    I don't believe this issue is resolved. I believe it is a fundamental flaw in the iPod. If I'm look for a Frank Zappa song, iPod sorts it so that it's filed under "F" for Frank. Blech. The problem is, iPod does not have artist first and last name fields, just "Artist".
    So the solution proposed above does work, but man, what a pain.
    In the case above, an alternative (and quicker?) solution is to change the Artist Name sort field to "Davis" or "Davis, Miles" click OK, then click apply Artist sort to all songs by this artist, which iPod will do gracefully. But, man, with over 3,000 songs and who knows how many hundreds of Artists, Albums, and individual cuts, what an arduous process!
    The fix is to have first and last name fields or to get "smart" and recognize a space between names so that an algorithm could be written to sort properly. Of course in that scenario, doing a mass conversion, "Led Zeppelin" would be filed as "Zeppelin, Led". Argh. (File as Zep).

  • How do I sort artists by last name in iTunes?

    HHow do I sort artist by last name in iTunes without tagging each album?

    For individual songs, Get Info has a sort field.  If you have a lot of songs, it will still be a lot of work to get caught up, though.
    Good luck
    srb

  • Sort artists with numbers as their names first

    Not to long ago, iTunes used to sort artists that had numbers in their names (311, 2pac, 50 cent)
    first on the list, which i loved because numbers should always come before letters, but in the recent updates with itunes, numbers are now last after the Z's
    Can someone give me a solution for this? a registry key or something maybe?

    I did a litle cheat. I have some artists that I WANT to list at the top and before I did the
    1. [artist name]
    2. [artist2 name]
    But since they decided to list these at the bottom (stupid decision), I mass updated the info on each artist to start with a.1, a.2, a.3, etc. This now lists the artists at the top in the order I want them in. A very nice easy workaround. No telling what Apple will do down the road, it's obvious they think #'s should be after letters. Contrarian company, I swear.
    Message was edited by: Jerry Ferguson1

  • I lost all of my artist names and album names for my iTunes library. They are all now on one album. How can I get the album and artist names back?

    I lost all of my artist names and album names for my iTunes library. They are all now on one album. How can I get the album and artist names back?

    I have a script called ExportImport for this task, but it only runs in Windows.
    In principle something similar should be possible in AppleScript, but I don't currently have access to a Mac to write it myself.
    tt2

  • Itunes 11 sorts album under different artists name in the artist view - any idea why?

    I have just be kindly given the Maroon 5 Holiday gift via 12 days (thanks iTunes).  I also have their album 'songs about Jane' and a track from a Rihanna album which is a Maroon 5 track featuring Rihanna but issued on the Rihanna album.
    When sorted by Album the Maroon 5 albums and Rihanna track are sorted together under Maroon 5.
    However, when sorted by Artist the artist for the Album 'Songs about Jane' is being shown as Rihanna (?) but when I check the 'Get Info' data Maroon 5 are clearly shown as the Album Artist.  The holiday gift and the Rihanna track are shown under the artist Maroon 5.
    Wierd ... any ideas why and how to correct?

    Wish I did. I tried the group function but that didn't help in iTunes. The search function is the best I came up with. I can answer the question do you have susch and such artist. But I can't browse for an artist I don't remember exactly or have misspelled. Fortunately I don't think I've bought anything from iTunes that i already had. If you can't see an artist it's possible you think you don't have something you actually do have. Sorry, still hoping for a better work around or better yet a fix.

  • For some artists in my Music app on my I-phone, the songs do not appear when I search by the artist.  However, if I search the album name, all the songs show.  How do I get the songs to show under songs?

    For some artists in my Music app on my I-phone, the songs do not appear when I search by the artist.  However, if I search the album name, all the songs show.  How do I get the songs to show under songs?

    Hi Spam_Valley,
    I understand that you are having issues with your music displaying correctly. This may be an issues with the metadata stored within that song, and iTunes interpretation of that info.
    We may need to repair this. See the following resources for information:
    iTunes 10 for Windows: If song titles don’t appear correctly
    http://support.apple.com/kb/PH1468
    Fixing Incorrect Song or Album Listings in iTunes
    http://support.apple.com/kb/TA24677
    Thanks,
    Matt M.

Maybe you are looking for