Re: New iTunes Track
Re: New iTunes Track
- Subject: Re: New iTunes Track
- From: Andrew Oliver <email@hidden>
- Date: Tue, 24 Feb 2004 19:07:35 -0800
On 2/24/04 6:10 PM, "Matthew Smith" <email@hidden> wrote:
>
"... you would need iTunes to be able to notify you when there is a change,
>
which it can't do. "
Change that to "which it doesn't do", not "can't do"
>
"Unfortunately that's not how AppleScript was designed to work."
Wrong again.
There's absolutely no reason why an application can't call a script on
specific events. In fact, the original AppleScript specification classified
AppleScript support at various levels ranging from 'basic' (app responds to
events sent via AppleScript), 'recordable' (speaks for itself) and
'attachable' - I may have the specific names wrong, but the last option
means the application supports invoking scripts within the application
itself.
The problem you describe is due to the APPLICATION developer not adding the
feature, not an inherent limitation of AppleScript itself.
There are applications out there that support attachable scripts. iTunes
just isn't one of them.
Andrew
:)
>
on 25/02/2004 10:55, Greg Townsend at email@hidden wrote:
>
>
> Is there a way to use AS to determine when the track playing in iTunes
>
> changes? I know you can use an idle handler, but I'd rather not have to
>
> poll iTunes any more than is necessary, and I'd also like to know when
>
> the track changes. Thanks.
>
>
There's no other way, other than polling. For it to be otherwise you would
>
need iTunes to be able to notify you when there is a change, which it can't
>
do. Each time you should record the current id of the track and compare it
>
to the previous time you checked. If it is different then the track has
>
changed.
>
>
There seems to be a lot of times where people want to run an AppleScript
>
when specific events occur, like know when an application is launched or
>
quit. Unfortunately that's not how AppleScript was designed to work.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.