Send variables back to Rev from Applescript

Thierry Arbellot thierry.arbellot at wanadoo.fr
Fri Aug 20 08:46:01 CDT 2004


Marian,

you should remove the quotes if you put the script into a field
try like this:
get (system attribute "ram ") / 1048 div 1000

Thierry

On Friday, Aug 20, 2004, at 15:05 Europe/Paris, Marian Petrides wrote:

> When I implement Thierry's suggest exactly as written in a button 
> script everything works fine.
>
> on mouseup
>   do "get (system attribute " &quote& "ram " &quote& ") / 1048 div 
> 1000" as appleScript
>   put the result into theRAM
>   put theRAM into fld 1
>
>  --now see if I can manipulate the variable which was passed
>   put theRAM/2 into halfRAM
>   put halfRAM into line 2 of field 1
> end mouseup
>
>
> However, if I paste the very same command into field 2 and change the 
> button script to read
>
> on mouseup
>   do fld 2 as appleScript
>   put the result into theRAM
>   put theRAM into fld 1
> end mouseup
>
> I now get a compiler error.  And this isn't simply a copy/paste error 
> since I get the same error if I manually type:
>             get (system attribute " &quote& "ram " &quote& ") / 1048 
> div 1000
> into field 2
>
> Any one have thoughts as to why this should be happening?
>
> Thanks.
>
> Marian
>
>
>
>
>
>
>
> On Aug 20, 2004, at 8:34 AM, Thierry Arbellot wrote:
>
>> I haven't too much experience with Applescript in Rev, but I can help 
>> in a simple script.
>> I use the following script to get the physical ram of the computer 
>> and I get the returned value into "the result" variable.
>>
>>     do "get (system attribute " &quote& "ram " &quote& ") / 1048 div 
>> 1000" as appleScript
>>     put the result into theRAM
>>
>> Thierry
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list