Skip to main content
August 27, 2013
Answered

How to run a Plugin, without opening Adobe indesign

  • August 27, 2013
  • 1 reply
  • 1663 views

Hi,

Does anyone know how to run a plugin as a service or something like that...

What i want to do is,

    I have written a plugin that can read texts from indd files & save them as .txt files.

now i want to put indd files in to a folder & once a new file comes to the folder, read that new file automatically  and save as txt.

for that I want to run the plugin, without opening the indd file.

I hope CS6 SDK support to do that.

Please let me know if anyone has any idea...

Thanks.

This topic has been closed for replies.
Correct answer Jim Birkenseer

It sounds to me like you can do what you need with an IdleTask. To use an IdleTask in your plug-in, you would implement a class based on CIdleTask.

When an IdleTask is started it will be called periodically, based on your task's settings. You can start your plug-in's IdleTask running when InDesign is launched. In your case, I'm guessing that the IdleTask would check to see if there are any files to process in a particular folder.

You can find examples of implementing an IdleTask in couple of the sample plug-ins that Adobe includes in the SDK: CustomDataLink and PanelTreeView (there may be others).

The CustomDataLink plug-in starts up its IdleTask in CusDtLnkStartupShutdown::Startup() and stops it in CusDtLnkStartupShutdown::Shutdown() in CusDtLnkStartupShutdown.cpp. The RunTask() method (which does the work) is defined in CusDtLnkLinkResourceStateUpdaterIdleTask.cpp.

PanelTreeView implements its IdleTask similar to the way CustomDataLink plug-in does, so you might want to check that sample out as well.

I hope this helps!

-- Jim

1 reply

Community Expert
August 29, 2013

I dont understand what you want to do exactly, is it not to open InDesign file or not open InDesign application.

I will answer for both the scenarios.

1. If its not opening InDesign application then i think you will have to tweak your workflow, becuase in this case you will be faced with a problem of interpreting the InDesign File outside of InDesign as it is a proprietary binary format. So  what you could do is use IDML files and then work with these files to get the text out of InDesign. Since IDML is an XML format you don't require InDesign application running or installed to work with it. Look the below link for more details on IDML

http://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs5_docs/idml/idml-cookbook.pdf

2. Not opening the InDesign file, if this is what you want i dont understand how do you intend to get the data out of the INDD file then. If you mean that you dont want to make it(INDD doc) visible while opening then you could open the file but not open a layout window of the document.

Your case seems to be a scenario where you can use InDesign server wherein your code will keep monitoring a hot folder and do the conversion of the newly placed InDesign file into the format you require.

Hope this helps.

-Manan

-Manan
August 29, 2013

Hi Menan,

Thank you very much for your reply...

I'll explain you what my requirement is,

My final goal is to run the Indesign application(including my plugin) in a server &  put all indd files in to a location(ex.folder) &

once an indd file comes to that folder it'll be automatically read by Indesign application & save the extracted data in a separate location(ex.another folder) as tex files. then human interaction is not needed...

My precsent problem is,

       Can I read an indd file, without opening indd file in Indesign application (may be giving a path to a indd files included folder or some way like that).

Currently,

  first i open the Indesign Application -> Open the indd file(intended to be read) -> Run my plugin.

Now I Get the document with,


IDocument* document = Utils<ILayoutUIUtils>()->GetFrontDocument();

But what I want is,

while the Indesign application is running on a PC, if an indd file comes to a given location(folder) it to be read automaticaly without opening my pluging.

To do that My idea is,

  * Any time when the Indesign apllication is opend my plugin should automatically start running,

* once a new file comes to a given location(folder) plugin shoud be automatically triggered & read the file.

Please help me with your ideas..

Thanks.

Jim BirkenseerCorrect answer
Inspiring
September 14, 2013

It sounds to me like you can do what you need with an IdleTask. To use an IdleTask in your plug-in, you would implement a class based on CIdleTask.

When an IdleTask is started it will be called periodically, based on your task's settings. You can start your plug-in's IdleTask running when InDesign is launched. In your case, I'm guessing that the IdleTask would check to see if there are any files to process in a particular folder.

You can find examples of implementing an IdleTask in couple of the sample plug-ins that Adobe includes in the SDK: CustomDataLink and PanelTreeView (there may be others).

The CustomDataLink plug-in starts up its IdleTask in CusDtLnkStartupShutdown::Startup() and stops it in CusDtLnkStartupShutdown::Shutdown() in CusDtLnkStartupShutdown.cpp. The RunTask() method (which does the work) is defined in CusDtLnkLinkResourceStateUpdaterIdleTask.cpp.

PanelTreeView implements its IdleTask similar to the way CustomDataLink plug-in does, so you might want to check that sample out as well.

I hope this helps!

-- Jim