Applescript question - request cmd
Jim Ault
JimAultWins at yahoo.com
Wed Aug 30 15:38:11 EDT 2006
Thanks, Jan,
I already have several utility scripts for doing the Applescript cmd
building. I found the request command in the Rev reference and thought I
would check it out for simple cases. Now that I know, I stick with my lib
of wrappers.
BTW, I did find the following link on the Apple site:
http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptL
angGuide/index.html
then look down near the bottom of the left hand scroll 'menu' for
Error Numbers and Error Messages, then click.
-1708 is <reference> doesn't understand the <commandName> message.
which must mean that Excel does not understand the 'eval' message, like you
said, Jan.
Jim Ault
On 8/30/06 12:26 PM, "Jan Schenkel" <janschenkel at yahoo.com> wrote:
> --- Jim Ault <JimAultWins at yahoo.com> wrote:
>> Got error -1708 when sending Apple event
>>
>> in the dictionary
>>
>> request "the hilite of button 3" from program
>> "HyperCard"
>> Use the request command to obtain data from another
>> application via the eval
>> Apple event.
>>
>> on testAS
>> request "address of active cell" from program
>> "Microsoft Excel"
>> request "value of active cell" from program
>> "Microsoft Excel"
>> request "get value of active cell" from program
>> "Microsoft Excel"
>>
>> any of the above run from a script container gives:
>>>> Got error -1708 when sending Apple event
>>
>> -- put "tell application "&q&"Microsoft
>> Excel"&q&return into cmd
>> -- put "get address of active cell"&return after
>> cmd
>> -- put "get value of active cell"&return after
>> cmd
>> -- put "end tell"&return after cmd
>> -- do cmd as applescript
>>>> correct result
>> put it & cr & the result
>> end testAS
>>
>>
>> Question 1 - what am I missing to get the 'request'
>> cmd to work
>>
>> Question 2 - Where can I find the error codes so I
>> know what is wrong?
>>
>> Thanks,
>>
>> Jim Ault
>>
>
> Hi Jim,
>
> The 'request' command requires that the other
> application implements the 'eval' apple event.
> HyperCard was one of the few to implement it (along
> with FoxPro, IIRC), but it looks like Excel doesn't
> implement that particular apple event.
>
> And that's why your more convoluted second approach
> (building an AppleScript) works, as it sends the
> proper apple events to Excel.
> You could rework that into a generic 'getFromExcel'
> function that builds the AppleScript, executes said
> AppleScript, and returns the value of 'it'.
>
> The advantage of such a wrapper is that you can then
> add a platform check, and build and execute a VBScript
> instead of an AppleScript if your application is
> running on Windows.
>
> Jan Schenkel.
>
> Quartam Reports for Revolution
> <http://www.quartam.com>
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same time." (La
> Rochefoucauld)
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list