Re: How to return a list from a script command
Re: How to return a list from a script command
- Subject: Re: How to return a list from a script command
- From: Pascal Pochet <email@hidden>
- Date: Sat, 3 Sep 2005 17:37:19 +0200
Returning an NSArray should work...
(it works for me...)
For example in scriptable PostgreSQL client of mine, I have an entry
<key>tableNames</key>
<dict>
<key>AppleEventCode</key>
<string>CoTN</string>
<key>ReadOnly</key>
<string>YES</string>
<key>Type</key>
<string>NSArray</string>
</dict>
implemented as
- (NSArray *)tableNames
{
return [_database tables] ;
}
and it works perfectly
Pascal Pochet
email@hidden
----------------------------------
PGP
KeyID: 0x208C5DBF
Fingerprint: 9BFB 245C 5BFE 7F1D 64B7 C473 ABB3 4E83 208C 5DBF
Le 03-sept.-05 à 16:23, Bill Cheeseman a écrit :
My Cocoa subclass of NSScriptCommand represents an AppleScript
command that
returns a list. I therefore return an array of script object
specifiers from
my override of -performDefaultImplementation. My sdef file defines
a command
result of <type type="specifier" list="yes">. The command works
when used in
a script, except that the list it returns contains only the first
element of
many in the array.
The same thing happens when I return an array of the actual objects
(evaluated specifiers), and define the result type as <type
type="mytype"
list="yes"> in the sdef file.
What should I do to make the command return the complete contents
of the
array?
(Ken Victor asked essentially the same question on Cocoa-Dev a
couple of
weeks ago and received no response.)
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden