Re: iTunes play - pause script
Re: iTunes play - pause script
- Subject: Re: iTunes play - pause script
- From: John Gnaegy <email@hidden>
- Date: Fri, 26 Jul 2002 03:04:24 -0700
Best thing to do is to put in a "display dialog" so you can tell what
that value is. Just add these lines:
>
tell application "iTunes"
>
set x to the player state as text
activate
display dialog x
>
if x = "playing" then
>
pause
>
else
>
play
>
end if
>
end tell
Now the creepy part is when it's run from Script Editor, it either
shows the string "stopped" or "playing". But when run as a script it
shows <<constant ****kPSS>> or <<constant ****kPSP>>. Whether that's a
bug or a feature, who knows, but it's easier to write around the
behavior than to wait for Applescript to change it.
So, you can do this instead. Just leave out the coercion to text.
tell application "iTunes"
if player state = playing then
pause
else
play
end if
end tell
---
John Gnaegy
colorsync
_______________________________________________
colorsync-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/colorsync-users
Do not post admin requests to the list. They will be ignored.