Re: Javascript wrapper for Applescript
Re: Javascript wrapper for Applescript
- Subject: Re: Javascript wrapper for Applescript
- From: David Andrews <email@hidden>
- Date: Wed, 9 Jun 2004 21:00:36 -0400
On Jun 9, 2004, at 7:37 AM, Dennis Cox wrote:
----------
From: David Andrews
Sent: Tuesday, June 8, 2004 10:30 PM
To: email@hidden
Subject: Javascript wrapper for Applescript
How is a Javascript wrapper put around an applescript?
I'd like to have Javascript do the following AS:
tell application "RealOne Player" to GetURL
"rtsp://archive.wfmu.org/archive/SP/sp020112.rm?start=2:48:47&end=2:
52:
19&title=\"Trooper's Nag - Spriguns of Tolgus\""
BTW: When the script runs, the RealOne Play window reverts to its
default size. Is there a way to tell it, using System Events, to "Zoom
Window" in the "Window" menu so that it goes back to its former size?
Everything I've tried gives "AppleScript Error, System Events got an
error: NSReceiverEvaluaionScriptError: 4"
Thanks
I can do Javascript from AS, don't know how to do it the other way.
As for your second question, did you try this? Watch the breaks, the
click
menu ... menu bar 1 command should be on one line.
tell application "RealOne Player" to activate --to get the right menu
tell
tell process "RealOne Player"
click menu item "Zoom" of menu "Window" of menu bar item "Window" of
menu bar 1
end tell
end tell
end
Yes, I tried it and get the above error, in fact, I've tried it for
Mail and Address Book and get the same error with those apps as well --
so what gives? (I also tried "Zoom Window" in place of "Zoom" in
RealOne Player since that is how it appears in the "Window" menu of
that app.)
I'm running MacOS 10.3.4, Script Editor 2.0 (v4.3), AppleScript 1.9.3.
I can tell application "System Events"
...
tell process "RealOne Player"
keystroke " " -- the space key toggles the pause/play button
...
which works just fine.
Unfortunately, there is no keystroke for the "Zoom Window" menu item,
so I added one.
How do I "keystroke" a Command-Shift-z?
Or, perhaps if I could tell System Events to click the green (+) button
on the RealOne Player window (which would also zoom the window), how
would I do that?
_______________________________________________
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.