Re: iTunes player state
Re: iTunes player state
- Subject: Re: iTunes player state
- From: Sander Tekelenburg <email@hidden>
- Date: Sun, 2 Jun 2002 06:01:31 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[Please don't mail me privately without a good reason. I didn't set a
Reply-To header pointing to the list for nothing. By keeping things on the
list, everybody can enjoy the answers, and others can chime in to add
information, or to point out wrong information. Thank you.]
At 04:37 +0200 UTC, on 02-06-2002, Salanki Benjamin wrote:
>
Hi!
>
>
> tell application "iTunes"
>
> get player state
>
> end
>
>
I know. But how do I extract info from this?
>
How do I actually know if
>
its playing, stopped or paused?
OK. Sounds like you're new to scripting. (That's OK :)).
The above gives you the result, but you'll only see it if you have Script
Editor's "Event Log" and or "Result" window open. I suggest you have them
open always, until you find a good reason (it does exist) to keep it closed.
But of course you don't just want to read the result, you want the result to
be available to your script. So you want to store the result in a variable.
For instance, like so:
tell application "iTunes"
get player state
set theState to the result
end
The variable theState will now be something like "playing". So you can now
use it in for instance an if/then statement. Like:
if theSate is "stopped" then
tell app "iTunes"
play
end
else
display dialog "Can't you hear iTunes is playing?"
end
HTH
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <
http://www.pgp.com>
iQA/AwUBPPmYlesywKfXgqKdEQK8aQCeKVoPR8ke9XevI7Gn8skYQ62/1UAAoPhQ
KKIdiALOGpwmEzhOQEWUcGnc
=AheM
-----END PGP SIGNATURE-----
--
Sander Tekelenburg, <
http://www.euronet.nl/~tekelenb/>
_______________________________________________
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.