Adapt some iTunes scripts for RealPlayer?

I have some iTunes scripts (from Quicksilver) to Play, Pause, Mute etc. & would like to adapt them to use with RealPlayer if possible.

A couple of them I changed the application name in the scripts from iTunes to RealPlayer & work fine:
+tell application "RealPlayer" to pause+ & +tell application "RealPlayer" to play+
(Although they give a 'missing value' message at the bottom of Script Editor).

A couple that don't work by just changing the name of the app are Play/Pause (toggle) & Mute

Here are the iTunes scripts for those:

tell application "iTunes"
if player state is playing then
pause
else
play
end if
end tell

And

tell application "System Events" to if (application processes whose name is "iTunes") is not {} then ¬
tell application "iTunes" to set mute to not mute

Any ideas how I could get these to work (or something similar) for RealPlayer?

Power Mac G5 Dual 2.3, 4.5 GB RAM, 20" ACD | MacBook Pro 2.0 15" 2 GB RAM, Mac OS X (10.5.2)

Posted on Mar 28, 2008 7:12 AM

Reply
8 replies

Mar 28, 2008 8:01 AM in response to JonoH

Despite the seeming similarity between iTunes and RealPlayer, you can't rely on them supporting the same set of commands. AppleScript support is entirely up to the developer, and they can add (or remove) any commands they think are relevant.

You can see what commands any application supports by opening the application's dictionary in Script Editor (just drag the application to Script Editor to see it). If you do this, you'll see that RealPlayer doesn't have any equivalent commands for what you're trying to do.

Therefore, until Real update their application to support more commands, you may be out of luck.

Mar 28, 2008 10:50 AM in response to JonoH

Those with 'Tiger' (MacOS X 10.4.x) only need to use, such sample code as, ...

tell application "RealPlayer"
play

if (is muted of player 1) then
set is muted of player 1 to false
else
set is muted of player 1 to true
end if
end tell

Those with 'Leopard' (MacOS X 10.5.2) need to use, such sample code as, ...

tell application "RealPlayer"
activate -- Required.
play

tell application 'System Events" to tell process "RealPlayer" to keystroke (ASCII character 31) using command down & shift down
end tell

Naturally, one can include ...

if (is muted of player 1) then
.
.
end

... within their code.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Adapt some iTunes scripts for RealPlayer?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.