Xojo Conferences
MBSOct2019CologneDE

AE: returning records (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: FileMaker via ODBC - anyone doing this ??
Next thread: Is it time for REAL Software to start phasing out classic support?


AE: returning records   -   Artur Moniuszko
  Re: AE: returning records   -   Will Leshner
  Re: AE: returning records   -   Artur Moniuszko
   Re: AE: returning records   -   Will Leshner
  Re: AE: returning records   -   Artur Moniuszko

AE: returning records
Date: 07.05.02 06:28 (Tue, 7 May 2002 00:28:01 -0500)
From: Artur Moniuszko
Hi,

Maybe this time someone will know the answer:
How do I populate and return an AppleScript record to an AppleEvent
query? I mean this kind of format: {label: "One", age: 18, coords:
{20,10}} I tried to use ae.replyDescList but I have no clue how to
label the items.

Thanks in advance.

Artur

----------------------------------------------------------------------
Rozmowy telefoniczne tansze nawet o 84%... bez komplikacji!
>>> http://link.interia.pl/f15b0


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: AE: returning records
Date: 07.05.02 06:44 (Mon, 6 May 2002 22:44:44 -0700)
From: Will Leshner
It's funny you should ask that. I was just messing with that but I
didn't really get it to work. If you look closely at the docs for
AppleEvent you'll see that there is, in fact, a ReplyRecord. So you make
a new AppleEventRecord, set the parameters by name (see the docs) and
set the AppleEvent's ReplyRecord to that. But I couldn't figure out what
names to give it. The script editor did get back a record, but it didn't
seem to like my names. I think it didn't mind "file", but others got
turned into <class "name">, and I'm betting that's wrong (but maybe not).

I choose to skip it and use a DescList, which is really just an array.
The only difference is that the items are key'd.

On Monday, May 6, 2002, at 10:28 PM, Artur Moniuszko wrote:

> Hi,
>
> Maybe this time someone will know the answer:
> How do I populate and return an AppleScript record to an AppleEvent
> query? I mean this kind of format: {label: "One", age: 18, coords:
> {20,10}} I tried to use ae.replyDescList but I have no clue how to
> label the items.
>
> Thanks in advance.
>
> Artur
>
> ----------------------------------------------------------------------
> Rozmowy telefoniczne tansze nawet o 84%... bez komplikacji!
>>>> http://link.interia.pl/f15b0
>
> ---
> Subscribe to the digest: <mailto:realbasic-nug-
> <email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: AE: returning records
Date: 07.05.02 08:27 (Tue, 7 May 2002 02:27:04 -0500)
From: Artur Moniuszko
Thanks Will,

In the meantime I seem to have found the answer...
rec1 = new AppleEventRecord // just as you suggest
rec1.integerParam("abcd") = obj.integerProperty
rec1.integerParam("efgh") = obj.anotherIntegerProperty
rec1.stringParam("ijkl") = obj.stringProperty

the key names should follow the property IDs in your AE dictionary,
and the human labels will be substituted in the AS editor/result
window/wherever automagically.

Now I have to grasp an object unique IDs, as referencing them by
index seems to cause a mess when you start to create and delete other
instances in between...

Thanks!

Artur

----------------------------------------------------------------------
INTERIA.PL: Portal pelen informacji >>> http://link.interia.pl/f15b7


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: AE: returning records
Date: 07.05.02 17:45 (Tue, 7 May 2002 09:45:12 -0700)
From: Will Leshner
Wow. Thanks. I actually kinda thought that it might be something like
that. I was in the process of going down something like that path, but I
hadn't done enough experimentation yet to verify it. You've saved me the
trouble.

Thanks.

On Tuesday, May 7, 2002, at 12:27 AM, Artur Moniuszko wrote:

> Thanks Will,
>
> In the meantime I seem to have found the answer...
> rec1 = new AppleEventRecord // just as you suggest
> rec1.integerParam("abcd") = obj.integerProperty
> rec1.integerParam("efgh") = obj.anotherIntegerProperty
> rec1.stringParam("ijkl") = obj.stringProperty
>
> the key names should follow the property IDs in your AE dictionary, and
> the human labels will be substituted in the AS editor/result
> window/wherever automagically.
>
> Now I have to grasp an object unique IDs, as referencing them by index
> seems to cause a mess when you start to create and delete other
> instances in between...
>
> Thanks!
>
> Artur
>
> ----------------------------------------------------------------------
> INTERIA.PL: Portal pelen informacji >>> http://link.interia.pl/f15b7
>
> ---
> Subscribe to the digest: <mailto:realbasic-nug-
> <email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: AE: returning records
Date: 08.05.02 02:50 (Tue, 7 May 2002 20:50:46 -0500)
From: Artur Moniuszko
Will wrote:

>...but I hadn't done enough experimentation yet to verify it. You've
>saved me the trouble.

No problem, Will, I know what you mean: given the amount of
documentation on parsing AE, it still takes lots of trial-and-error
drill, and what makes it even more painstaking is that you cannot
receive your app's AE in debugBuild, so every experiment requires
another build...

Implementing AE has a very nice side effect on me, teaching a
thoughtful way of OO programming. To me it appears that for AE
purposes most of the methods should be functions (returning a value)
rather than subs. An example: when I wrote a sub which places a new
object at a correct (sorted) position in an array (i.e. .append vs
.insert) I did not care about the objects final index until I had to
return the index for AE object descriptor. Following that change, I
had to modify my code not to ignore function results. This limitation
really bothers me... [3.5.2]

OK, anyone willing to speak out on their experience implementing AE?
I would be curious to listen...

Best,

Artur

----------------------------------------------------------------------
INTERIA.PL: Portal pelen informacji >>> http://link.interia.pl/f15b7


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>