Le 1 ao=FBt 04, =E0 07:12, jcb a =E9crit :
> How do you send a pointer to an object as a parameter to a message?
>
We use the Pointer class to deal with pointers. See page 118 in the=20
F-Script manual.
> I set up:
> error :=3D NSDictionary
> leScript :=3D NSAppleScript alloc
> leScript initWithSource:'tell application \"Firefox\" activate end=20
> tell'
> and then try
>
> leScript executeAndReturnError:&error
Try this instead:
error :=3D Pointer malloc:8.
leScript :=3D NSAppleScript alloc initWithSource:'tell application=20
"Terminal" \n activate \n end tell'.
leScript executeAndReturnError:error.
This should activate the Terminal application.
Note that you can't directly dereference Pointer objects with F-Script.=20=
In this case, this means that you can't get at the dictionary pointed=20
by "error" if there is an error during the execution of the Applescript=20=
script. This limitation will be removed in the next version of=20
F-Script, where we will have support for dereferencing.
Best,
Phil
|