Quantcast
Channel: Adobe Community : Popular Discussions - InDesign SDK
Viewing all articles
Browse latest Browse all 78596

Error when trying to run script using SDK at plugin startup

$
0
0

Hi

 

I am trying to run a script when my InDesign plugin is loaded. I referred to the PanelTreeView sdk sample as an example and implemented a StartupShutdown Boss

In my implementation, in the startup() method I have the code to get the scriptManager and the scriptRunner for my javascript that I want to run. However, when my code hits the following line :

 

          InterfacePtr<IScriptRunner>theRunner(Utils<IScriptUtils>()->QueryScriptRunner(scriptFile) ); //scriptfile is ID script file that I want to run

 

          I get the error saying "Calling ScriptInfoDatabase::InitScriptInfoManager before resources have been registered".

 

 

I am wondering how I can fix this error. or if this is too early to invoke scriptrunner, then is there some other place where I can invoke the scriptrunner to run my script

 

this is how I have defined my StartupShutdown Boss class in  the .fr file

    Class
     {
         kmyStartupShutdownBoss,
         kInvalidClass,
         {
             /** Implementation of IStartupShutdownService that runs a  scripts on startup */
             IID_IAPPSTARTUPSHUTDOWN, kmyStartupShutdownImpl,
             /** identify the service type */
             IID_IK2SERVICEPROVIDER, kCStartupShutdownProviderImpl,
         }
     },

 

 

 

Appreciate any help on this one .. thanks!

 

Sameer


Viewing all articles
Browse latest Browse all 78596

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>