Skip to main content
Legend
Oct 26, 2025 11:02 AM UTC
Question

How do you create global variables in a C++ plugin?

How do you create global variables in a C++ plugin?

1 reply

Community Expert
Nov 19, 2025 2:59 AM UTC

Multiple ways I suppose. I am stating generically as I don't know your specific context/usecase

Staying within the InDesign SDK constructs you can use the following

  • Add non persistent interface to boss classes like session, workspace. Set and get them as per your needs
  • Using IBlackBoxCommands which can store key/value pairs

Outside InDesign SDK

  • Something like a singleton class which is set/get as needed and accessible in any code file

-Manan

Translate
-Manan