Skip to main content
Participant
May 14, 2025
Question

Issue with Script Properties Not Serializing via kTextObjectScriptElement During IDML Export

  • May 14, 2025
  • 1 reply
  • 296 views

Hi all,

In our plugin, we’re trying to serialize text-related settings into IDML. We’ve defined a custom scripting provider like this in our .fr file:

Object{ kTextStyleRangeObjectScriptElement },
Object{ kTextObjectScriptElement },

Property{ kSliParaChangesPropScriptElement, kReadWrite },
Property{ kRuleParaChangesPropScriptElement, kReadWrite },

 

This should expose our properties to text-level objects like paragraphs, characters, and text style ranges.

We implemented the scripting interface in our provider:

ErrorCode TextScriptProvider::AccessProperty(ScriptID propID, I_SCRIPT_REQUEST_DATA* data, IScript* script)

 

The Issue:

 

During IDML export, AccessProperty() is only called once, and only for one ScriptID. We expected it to be called for all registered properties, especially if the attributes are attached.

However, if we switch the Object{} definition to this:

 

Object{ kTextStyleRangeObjectScriptElement },
Object{ kPageItemObjectScriptElement },

 

then all script IDs get serialized during IDML export  but we know this is incorrect because kPageItemObjectScriptElement is intended for frames and graphics, not text content.

 

so the question is

Is there a correct way to ensure all relevant ScriptIDs are serialized/exported using kTextObjectScriptElement and kTextStyleRangeObjectScriptElement  ?

 

We do ensure that our custom attributes are applied to the text so any insights into how the IDML export engine chooses which script properties to serialize on text objects  and how to ensure it sees ours  would be appreciated!

1 reply

Legend
May 16, 2025
These should do for paragraph attributes:
Object { kTextObjectScriptElement }
Object { kStoryObjectScriptElement }
Object { kParagraphStyleObjectScriptElement }
Object { kTextDefaultObjectScriptElement }
 

Otherwise add

Object { kCharacterStyleObjectScriptElement }

 

As you don't mention it, make sure to use kCoreScriptManagerBoss in the contexts.

 

Legend
May 16, 2025

Quick reminder - make sure to use the appropriate responder to add the default value to the text defaults, e.g. for opened documents.

Also don't forget the ignore tags resource in case the documents should open without your plug-in. Add a test case for that, it is difficult to repair on existing docs  …