Re: applescript parsing: list of record types
Re: applescript parsing: list of record types
- Subject: Re: applescript parsing: list of record types
- From: Alastair Houghton <email@hidden>
- Date: Mon, 22 Oct 2007 18:03:43 +0100
On 22 Oct 2007, at 17:14, Ken Victor wrote:
for one of my script commands specified in my sdef file, i've
specified the direct parameter to be of type="my record type"
list="yes" where "my record type" is defined in the sdef as a
record-type element.
and if i turn i AEDebugReceives, i can see the list of records
coming in. however, cocoa scripting complains that it can't make
the list into a "my record type".
i've discovered that if i specify in my sdef to take a list of
type="any", i can then get the data, but i get it as an aedesc,
which i then have to parse myself. and the documentation in the
script directory seen by the user is misleading.
have i encountered a (known) limitation of cocoa scripting? or
perhaps a bug? is there perhaps another way to write my sdef so
that i don't have to parse the sdef myself? or is there perhaps
some method i can/should override in NSScriptCommand to properly
handle this?
The only limitation I remember in this area (though I'm hardly an
expert on the AppleScript <=> Cocoa side of things) is that you can't
pass an arbitrary record from AppleScript to Cocoa without using
type="any" because Cocoa has no way to map the record field names
into strings for use a NSDictionary keys (remember, AppleScript uses
four character codes, not strings). At least, I think that's the
problem I ran into...
So, is your record type defined in your sdef file? Is the syntax of
your sdef file correct?
You might be better asking on the applescript-implementors list
(which I've copied on this reply); even though this is Cocoa related,
you're still more likely I think to find help there than here. Of
course, I might be wrong :-)
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden