I'm just guessing here, and maybe Matt or Christiaan or someone
with more experience can set me straight if I'm wrong, but it seems
like "first scheduled order whose id is orderNumber" is returning a
row number (12) instead of the object you're expecting (scheduled
order). Make sure you're implementing - (NSScriptObjectSpecifier *)
objectSpecifier; on your Order class, and that it returns an
NSScriptObjectSpecifier subclass that is useful to you (we use
NSUniqueIDSpecifier because each of our CD objects has a unique id).
-
Mike Glass
email@hidden
On Nov 15, 2007, at 4:08 PM, Paul Bruneau wrote:
I want to thank everyone for helping me with my enumeration
problem including the tips on the utilities.
I would like to trouble you for one more piece of assistance. I do
not do so lightly--I have spent several hours trying to find the
cause for this problem.
I am working on implementing applescript into my Cocoa application
which is in development and I have it successfully getting and
setting properties of the main objects (orders). I have also
successfully implemented the core "make" command with properties
which is very handy for having FileMaker create new objects in my
app.
But I am being stumped by what seems like it ought to me such a
simple script. First, this works:
tell application "Scheduler"
activate
set orderNumber to "24777"
customer name of first scheduled order whose id is orderNumber
end tell
It returns the name of the customer.
But this next script fails with "Scheduler got an error: Can't
make customer name of <<class >> 12 into type reference. Here is
the script:
tell application "Scheduler"
activate
set orderNumber to "24777"
set myOrder to first scheduled order whose id is orderNumber
customer name of myOrder
end tell
For the life of me, I can't figure out why it fails when I try to
use the variable myOrder.
I am concerned that in the error message the <<class >> part seems
to have a blank class. That does not make sense to me but I don't
know where to look.
I have posted my .sdef to this handy code review site:
http://objc.pastebin.com/m5da48033