Re: iTunes multiple changes without repeat? Speeding up things.
Re: iTunes multiple changes without repeat? Speeding up things.
- Subject: Re: iTunes multiple changes without repeat? Speeding up things.
- From: Axel Luttgens <email@hidden>
- Date: Wed, 26 Mar 2008 16:08:46 +0100
Le 26 mars 08 à 14:01, Skeeve a écrit :
Hi!
Does anyone of you know of a way to make changes to the properties
of some tracks without looping?
Usually I do it like this:
property fixed_album_name : "This Is An Example"
tell application "iTunes"
if selection of front browser window is {} then
display alert "nothing selected."
return
end if
set these_tracks to selection of front browser window
set these_tracks_ref to a reference to these_tracks
repeat with tr in these_tracks_ref
set album of tr to fixed_album_name
end repeat
end tell
my "problem" now is, that I want to do several changes (it's a tag-
fix-script) and looping through all the trags and tags isn't very
fast. Especially because iTunes always refreshes the screen.
So I thought I could do something like this:
set album of every track of these_tracks_ref to fixed_album_name
which, of course, didn't work.
Is there another way to achieve that? Or is athere a way to make
iTunes stop refreshing the screen?
Many thanks in advance...
Hello Skeeve,
It looks like that by the use of an intermediate variable (i.e.
these_tracks), one is falling back to a standard AppleScript list.
Such a list may be handled through a very limited range of reference
forms, hence an error:
tell application "iTunes"
set these_tracks to selection of front browser window
get album of these_tracks
--> unable to get album of { file track..., ... }
end tell
On the other hand, allowing iTunes to work on its own objects seems to
be a step in the right direction:
tell application "iTunes"
get album of selection of front browser window
end tell
(for another example of such behavior, just have a look at the Finder).
Likewise, this one seems to be working too:
tell application "iTunes"
set album of selection of front browser window to "This Is An Example"
end tell
HTH,
Axel _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden