Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

Is there any way to register custom text variable type in InDesign?

New Here ,
Apr 06, 2023 Apr 06, 2023

Yashasvi28532490hvc5_0-1680773470060.png

Like here few default types are predefined , If someone wants to register a new type how can it be achieved.

TOPICS
Scripting , SDK , Type
533
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Guide , Apr 06, 2023 Apr 06, 2023

Hi @Yashasvi28532490hvc5 

 

At the scripting DOM level, variable types are fixed:

 

MarcAutret_0-1680779847650.png

 

but you can still work from the CUSTOM_TEXT_TYPE type and create a specific naming protocol for identifying your own variables (that is, those relevant to your process).

 

Best,

Marc

Translate
Guide , Apr 07, 2023 Apr 07, 2023

To follow up, there is indeeed a matching service kTextVariableServiceID. The interface ID is IID_ITEXTVARIABLESERVICE_PRIVATE though and as the name suggests it is not included in the SDK.

I guess it was too much trouble to handle documents with a new text variable type backed by a missing plug-in.

Translate
Guide ,
Apr 06, 2023 Apr 06, 2023

Hi @Yashasvi28532490hvc5 

 

At the scripting DOM level, variable types are fixed:

 

MarcAutret_0-1680779847650.png

 

but you can still work from the CUSTOM_TEXT_TYPE type and create a specific naming protocol for identifying your own variables (that is, those relevant to your process).

 

Best,

Marc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 06, 2023 Apr 06, 2023

Thank you Marc  

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 06, 2023 Apr 06, 2023

As you tagged this with "SDK": Enumerations are extensible by C++ plug-ins, it is just another declaration resource snippet similar to adding a JS property or class in the ScriptInfo database aka object model. Not all of the enumerations are backed by extensible features, though - some are just mapped to enumerations at the C++ side.

The typical approach would be a matching entry in the internal service registry, could also be a startup service that registers them in a factory.

 

If you meant to include that in "any way" I'd suggest to first have a look at the SDK programming guide and to search thru the headers for related constants and interfaces.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 07, 2023 Apr 07, 2023
LATEST

To follow up, there is indeeed a matching service kTextVariableServiceID. The interface ID is IID_ITEXTVARIABLESERVICE_PRIVATE though and as the name suggests it is not included in the SDK.

I guess it was too much trouble to handle documents with a new text variable type backed by a missing plug-in.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines