|
|
Improved script: Remove extra spaces from artists' names in iTunes
Thanks for posting this script!
It didn't work on my system (OX 10.2.4 with iTunes 3.0.1). The different issues are described below for anyone interested. Here is a modified script that worked for me:
The details:First, the original script ran for about a second and did not do anything, not even to test tracks with altered names with leading and trailing spaces. When I tested the main loop it did not produce a running list of track names. Did this work for anyone?
produces a list with one item which again is a list with references to the individual tracks. I needed a double imbedded loop like so
The script also suffers from some semantic flaws that often slow down scripts by an order of magnitude.
should only bracket statements that need to talk to iTunes, i.e. for getting or setting track info. All the other statements should be outside these tell blocks in order to avoid unnecessary AppleEvents being sent around the system.
The construct
first converts the song name string to a list of individual characters
and then converts it back to a string (hence the need for the "as string" coercion). The shorter (and much faster executing) syntax for removing the first character is
and similarly to remove the last character
This may not make a noticeable difference on all your 1GHz+ G4's but made things at least a little faster on my '97 vintage G3.
Finally I put in some beeps so I know that the script is doing something and a final dialog telling me what was fixed. (That dialog will not work if there are too many items ...) Structured programming buffs probably would have made the space stripping code into a handler, but I had to stop somewhere ;-)
Hope this helps, Klaus |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|