Rev && appleScript

Kay C Lan lan.kc.macmail at gmail.com
Tue Jan 13 18:57:18 EST 2009


On Wed, Jan 14, 2009 at 5:00 AM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

>
> To return a value back to Revolution, use the return command :-)
>
> put "set x to 12" & cr & "return x" into myScript
> do myScript as AppleScript
> put the result into rslt
>

Not a professional programmer so there may be a good reason to 'return' the
result, but I don't think it's necessary. I extract stuff from applescript
all the time to Rev without using 'return'.

Try this in Rev's multi-line Message box:

put "set x to 12" into myScript
   do myScript as AppleScript
put the result

My understanding is that whatever happened on the last line in applescript
will end up in 'the result' in Rev automatically. If applescript fails mid
execution I believe an error message, if there is one, will end up in Rev's
'the result'.

For cross platform compatibility maybe it's a good idea as I note the Doc's
mentioning defining a global variable 'result' in VBscript for Windows as no
automatic result occurs.

HTH



More information about the use-livecode mailing list