Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Applescript error - NSCannotCreateScriptCommandError
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript error - NSCannotCreateScriptCommandError



Hmm... I added support for -objectSpecifier to the class and put a breakpoint on it, but when I do:

set foo to name of current task

where 'current task' returns a Task object and 'name' is one of the functions on the object (setName is another), the breakpoints aren't hit on either the call to retrieve 'current task' or 'name'. I still get "NSCannotCreateScriptCommandError" in the script editor. If I do

set foo to current task

then the breakpoint to retrieve 'current task' in the NSApplication derived class is hit and THEN it hits the -objectSpecifier function. I'm probably missing something fundamental. Is my AppleScript syntax correct here? I should add that I did search the archives but none of the original discussions enlightened me.

- Steve


On Jul 8, 2004, at 2:34pm, Nick Zitzmann wrote:

On Jul 8, 2004, at 7:21 AM, Steve Palmer wrote:

No. Is that important? None of the samples or tutorials that I've seen mention it.

Yes. If you make an object accessible through AppleScript, then it must implement -objectSpecifier or else you won't be able to use the object as a script variable. For example, running "set theWidget to make new widget at front of widgets" followed by "open theWidget" will end with an error on that last line if -objectSpecifier is not implemented.

I'm not sure where this is documented, but I think you'll find more information about -objectSpecifier by checking the archives.

Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


- Steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Applescript error - NSCannotCreateScriptCommandError (From: Steve Palmer <email@hidden>)
 >Re: Applescript error - NSCannotCreateScriptCommandError (From: Nick Zitzmann <email@hidden>)
 >Re: Applescript error - NSCannotCreateScriptCommandError (From: Steve Palmer <email@hidden>)
 >Re: Applescript error - NSCannotCreateScriptCommandError (From: Nick Zitzmann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.