Resurrecting this copy of this issue again. I'm hitting this and
found the solutions from Dustin Voss and Jesse Grosjean on 7/13/05,
but those use private API and are thus subject to breakage (I haven't
tried the hack yet, but it looks promising).
If you all haven't logged Radars on this, please do so now :)
Mine is #4757651.
-tim
On Apr 2, 2006, at 9:24 PM, Scott Thompson wrote:
I've found the "make" command to be absolutely the most frustrating
AppleScript command to implement ever.
I want the script:
tell application "MM"
tell document 1
tell the central topic
make new subtopic
end
end
end
to send the "make" command that it generates to the "central topic"
object. To that end, in my sdef has a topic class that includes:
and my topic class implements the "handleCreateCommand:" selector.
However, when my application executes, the "default implementation"
of the make command is executed. I subclassed the NSCreateCommand
to examine it's behavior more closely. When the command is created,
the "receiver" is null and the default implementation ends up being
run.
I guess I just don't understand how this is supposed to work. I was
expecting that the current object being "tell-ed" would be the
default receiver of a command. Evidently that is not the case.
I noticed in gdb that the computer has a specifier to the
destination (something like "Container specifier for created object:
subtopic 1 of central topic of document 1") where the object should
eventually go. It looks like I could pull the first specifier off
of this (to make it just "central topic of document 1") in order to
get the context that I would like my make command to run in, but
there doesn't seem to be a way to get this specifier from the create
command in the code. Am I missing a method?