ScriptEditor thinks my command is a variable
ScriptEditor thinks my command is a variable
- Subject: ScriptEditor thinks my command is a variable
- From: Lee Ann Rucker <email@hidden>
- Date: Thu, 12 Apr 2007 15:29:32 -0700
I've got the core AppleScript commands working - I can tell my
document to close and it does, no problem, but when I try to get it
to run one of my new commands, ScriptEditor thinks it's a variable,
not a command:
tell application "myapp"
tell document 1 to start
end tell
(start is green. Should be blue).
It shows up as a command in the ScriptEditor dictionary for my app,
but apparently ScriptEditor's compiler is ignoring that.
What do I have to do to get AppleScript to see the "start" command?
I've pretty much cloned the definition of "close" for "start", except
it's in a different suite (though I've also tried having it in the
same suite as document):
<suite name="My Suite" code="vxVS"
description="Classes and commands for what I'm doing.">
<command name="start" code="vxVSstrt" description="Start a
thing.">
<cocoa class="MyScriptCommand"/>
<direct-parameter type="specifier"
description="the document(s) to start."/>
</command>
</suite>
added it to "document":
<suite name="Standard Suite" code="core"
description="Common classes and commands for all applications.">
...
<class name="document" code="docu" description="A document.">
<cocoa class="MyDocument"/>
...
<responds-to name="close">
<cocoa method="handleCloseScriptCommand:"/>
</responds-to>
<responds-to name="start">
<cocoa method="handleStartScriptCommand:"/>
</responds-to>
</class>
Try to run it in ScriptEditor, and I get "The variable start is not
defined."
MyScriptCommand is a subclass of NSScriptCommand; MyDocument is an
NSDocument.
Maybe I'm missing something obvious here - I've googled every
variation of AppleScript and Cocoa I can think of - but if it's some
kind of caching issue I have no idea how to clear it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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