I have this problem: On running this script in the Script-Editor it works perfectly.
tell application "iTunes"
set playerstate to get player state
end tell
display dialog playerstate
I get s player state running
, stopped
or paused
.
But if I export the script a application, I get something like kPSS
.
Where is the mistake?
player state
is a enumerated constant (actually an integer).
Just coerce the value to text
tell application "iTunes"
set playerstate to (get player state) as text
end tell
display dialog player state
Edit:
This should work also with an applet
tell application "iTunes"
if player state is paused then
set playerStateText to "Paused"
else if player state is playing then
set playerStateText to "Playing"
else
set playerStateText to "Stopped"
end if
end tell
display dialog playerStateText
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With