Re: itunes & text edit fun
Re: itunes & text edit fun
- Subject: Re: itunes & text edit fun
- From: Neil Faiman <email@hidden>
- Date: Sat, 19 Mar 2005 08:16:08 -0500
On Mar 19, 2005, at 2:06 AM, Patrick Collins wrote:
anyway the result of my script is.. it looks like its working, the
files are renaming before my eyes.. but then all of a sudden, one of
the tracks jumps to a different place.. and things are going totally
out of order.. and getting screwed up......... And I tried sorting by
different properties-- such as TIME, and Date Added.. since all files
are 1 second and they all were created at 10:30 tonight.. I would not
expect them to be moving, but they still jump around, and get out of
order.. So... Basically everything in the event log before itunes
shows that it is all perfect, and in the correct order... but once it
gets to itunes it goes crazy......
...
on itunesscript(titlename, albumname, artistname, composername)
set trackadvance to 0
tell application "iTunes"
activate
if selection is not {} then
set sel to a reference to selection
set number_of_tracks to count items of sel
repeat with aTrack in sel
set trackadvance to trackadvance + 1
set name of aTrack to (item (trackadvance) of
titlename as string)
set artist of aTrack to (item (trackadvance) of
artistname as string)
set album of aTrack to (item (trackadvance) of
albumname as string)
set composer of aTrack to (item (trackadvance) of
composername as string)
end repeat
end if
end tell
end itunesscript
Just a thought ... What are the selected tracks sorted on? (I.e., which
column is selected?) Your loop is processing "item 1 of the selection",
"item 2 of the selection", ... "item 31 of the selection". My best
guess is that the tracks are sorted on one of the fields that you're
updating, so that as you update the information, what used to be track
5 now becomes 4, or track 20, or ...
If that's the problem, this would probably solve it: first, do a loop
over all the tracks in the selection, setting their track number field.
Second, change the sort to "by track number" (either in AS, or
manually). Now apply your script, and the tracks should stay in order
while you modify them.
Good luck,
Neil Faiman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden