I'm trying to implement a trivial script command, byt have no success.. My sdef file
...
<class name="image" plural="images" code="imag" description="Image class">
<cocoa class="MyImage"开发者_Python百科 />
<property name="width" code="wdth" type="real" access="r" description="The width of the image."/>
<property name="height" code="hght" type="real" access="r" description="The height of the image."/>
<responds-to name="rotate">
<cocoa method="scriptingRotate:"/>
</responds-to>
</class>
<command name="rotate" code="frwkrota" description="Rotate the image.">
<direct-parameter type="image"/>
<parameter name="by" code="by " type="real" description="Degrees to rotate.">
<cocoa key="angle"/>
</parameter>
</command>
...
My dictionary is ok: image responds to rotate and so on.. But
tell application "MyApp"
rotate image 1 by 1
end tell
says that: "Expected end of line but found class name." Where is the mistake?
get image 1
works normally (MyImage have objectSpecifier).
SOLVED
Seems like it was a bug with ScriptEditor..
Restarting ScriptEditor solved the problem.
精彩评论