Dynamically changing scripting dictionary
Dynamically changing scripting dictionary
- Subject: Dynamically changing scripting dictionary
- From: Mark Dawson <email@hidden>
- Date: Fri, 7 Oct 2005 10:08:46 -0700
It appears that Cocoa allows for dynamic script dictionaries,
updating the app's dictionary when bundles are loaded in, via the
NSScriptSuiteRegistry. Is this correct? Does this mean that if I
load a plug-in that adds new objects or options to existing app
objects, that plug-in can supply updated script information, with the
result that the user can script that new functionality?
I had a follow-on question: How are script dictionaries recognized?
loadSuitesFromBundle says "Loads the suite definitions in bundle… for
each suite found". oadSuiteWithDictionary:fromBundle references .
scriptSuite property lists, with a mention of .sdef in 10.4.
I also wanted to make sure that I didn't remove any existing
registered pieces. For example, if my app supported font color and
size, I might have the following dictionary (from the Cocoa examples):
<class name="rich text" plural="rich text" code="ctxt"
description="Rich (styled) text">
<cocoa class="NSTextStorage"/>
<type type="text"/>
<property name="color" code="colr" type="color"
description="The color of the first character.">
<cocoa key="foregroundColor"/>
</property>
<property name="font" code="font" type="text"
description="The name of the font of the first character.">
<cocoa key="fontName"/>
</property>
<element type="character"/>
<element type="paragraph"/>
<element type="word"/>
<element type="attribute run"/>
<element type="attachment"/>
</class>
If I had a plug-in that added font size capability, would it have the
following definition?
<class name="rich text" plural="rich text" code="ctxt"
description="Rich (styled) text">
<cocoa class="NSTextStorage"/>
<type type="text"/>
<property name="size" code="ptsz" type="integer"
description="The size in points of the first character.">
<cocoa key="fontSize"/>
</property>
</class>
thanks,
mark _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden