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

Get signals from ID Main menu

Community Beginner ,
Jul 18, 2016 Jul 18, 2016

Copy link to clipboard

Copied

II want to to get signals (events, or messges or??) from the Adobe Application main menu.

Is the ActionMgr retrived from gSession the own one for addig an own menu to the ID main menu (already done) and to get the signals from the multiple applications File-Save-item actrions?

TOPICS
SDK

Views

6.1K

Translate

Translate

Report

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
Community Beginner ,
Sep 25, 2016 Sep 25, 2016

Copy link to clipboard

Copied

Hi Dirk,

that interface is usable to checking some attributes of the document, to be saved.

That is not the information I'm interested in.

I want the know the ActionComponent, handling the selecting of the 'File:Save' and 'File:Save As' menu items, to omit the standard dialog and to save myself the files of the different production orders to different folders (mobileOrderCases).

I told you, that we had implemented a similar CS2 Plug-In about 10 years ago and have had the required functionality there.

So fare I know the general logic, the ActionComponent, handling the selection of these two menu items is what I need to know.

Regards

Jochen

Votes

Translate

Translate

Report

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
Community Beginner ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Hi Manan,

I've implemented a boss class for ID Save, linked to an implmented IDSaveActionComponent.

Further more I've implemented MenuDef and ActionDef for the IDSave menue aat my fr-file.

At my StartupShutdown-Service I get a IDSavemenuMgr and a IDSaveactionMgr from the app by app->QueryActionManager().

The IDSaveActionComponent shall catch the kUIEMnuIDSaveMenuItemActionID, but it is never reached.

Seems that I did not get the right action compoment.

How to retrieve the ActionCompoment liked to the InDesign File-menu?

Obviusely that one I should use.

Regards

Jochen

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

concerning you 1. recommendation: The DocWch-sample seems th implement the required functionality, but it can't be build, due to missing Types.r on Win32.

I've never debugged a Plug-In. How to do that?

Concerning your 2. recomendation: Here is again the question, how to get connected to the main menu actions, is to be answered.

Jochen

Votes

Translate

Translate

Report

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
Community Expert ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

1. Did you follow the pointers given by Dirk on how to get the dependency sorted out in a Win project?

2. You should not worry about the menu action, if the only thing that you are interested in is save then the responder will fire when the user clicks on File>Save or File>Save As depending upon the service you subscribe. If you have some other specific requirement then let us know.

P.S.:- I will try and get hold of CS2 SDK and look into the building the sample plugin you are trying and update further on point no 1.

-Manan

Votes

Translate

Translate

Report

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 ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

I would assume that Types.r is in the MacOS SDK provided by CodeWarrior. On the other hand when you are compiling Windows resources (.rc) it should not get included - check your preprocessor definitions.

There is no sense in re-implementing the action mgr, you probably mean an action component for your own actions.

Besides search the forums for IID_IDOCFILEHANDLER, you should not use an action filter to interfere with operations such as Save, remember the UI is not the only place these get invoked. Hint: scripting ...

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

at the implementation of the MenuDefs and ActionDefs at my UIE.fr file occure problems.

When I try to setup the own menu and the DocWch Save menu within a single MenuDef segment I get errors concerning missing '}'

When I use two MenuDef-segments I get the compilation errors:

error R32655: # Warning: Duplicate resource: (000001fb)200.  Using the first one.

How can I add an own menu to the application and get signaled from the applications File:Save actions as well?

Kind regards

Jochen

Votes

Translate

Translate

Report

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
Community Expert ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

By what you say it seems for the missing } error you have a compilation error for that you need to look finely there ought to be a missing } somewhere near the reported line

As far as the duplicate resource issue is concerned, it seems you are defining something twice. I can't help unless i have the code in front of me in these cases.

And yes you can implement your own menus and also get signal responder work for the save menu in the same plugin.

Please go through the definition of your resource .fr file, i am sure you will catch the error.

-Manan

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

can you please let me know, if  the repeating implementation of

resource ActioDef (kSDKDefActionResourceID) as below is  correct, or how the two menus + action should be coded?

The code below is trowing the error R32655: # Warning: Duplicate resource: (000001fb)200.  Using the first one.

resource ActionDef (kSDKDefActionResourceID)

{

    {

//For Top-Menu USF   

//USF-About-Submenu

        kUIEMnuUSFActionComponentBoss,        

        kUIEMnuUSFAboutMenuItemActionID,   

        kUIEMnuUSFAboutMenuItemKey,   

        kOtherActionArea,                // Area name (see ActionDefs.h).

        kNormalAction,                    // Type of action (see ActionDefs.h).

        kDisableIfLowMem,                // Enabling type (see ActionDefs.h).

        kInvalidInterfaceID,            // Selection InterfaceID this action cares about or kInvalidInterfaceID.

        kSDKDefInvisibleInKBSCEditorFlag, // kSDKDefVisibleInKBSCEditorFlag or kSDKDefInvisibleInKBSCEditorFlag.

//USF-FD-Sub-Menu

        kUIEMnuUSFActionComponentBoss,

        kUIEMnuUSFFDMenuItemActionID,

        kUIEMnuUSFFDMenuItemKey,    // Key to the name of this action

        kOtherActionArea,

        kNormalAction,

        kDisableIfLowMem,

        kInvalidInterfaceID,

        kSDKDefInvisibleInKBSCEditorFlag,

       

//USF-Cancel-Sub-Menu   

        kUIEMnuUSFActionComponentBoss,

        kUIEMnuUSFCancelMenuItemActionID,

        kUIEMnuUSFCancelMenuItemKey,    // Key to the name of this action

        kOtherActionArea,

        kNormalAction,

        kDisableIfLowMem,

        kInvalidInterfaceID,

        kSDKDefInvisibleInKBSCEditorFlag,       

    }

};

//ActionDefs for DocWch   

resource ActionDef (kSDKDefActionResourceID)

  {

    {    

        kDocWchActionComponentBoss,         // ClassID of boss class that implements the ActionID.

        kDocWchAboutActionID,                // ActionID.

        kDocWchAboutMenuKey,                    // Sub-menu string.

        kHelpMenuActionArea,                        // Area name (see ActionDefs.h).

        kNormalAction,                            // Type of action (see ActionDefs.h).

        kDisableIfLowMem,                        // Enabling type (see ActionDefs.h).

        kInvalidInterfaceID,                    // Selection InterfaceID this action cares about or kInvalidInterfaceID.

        kSDKDefInvisibleInKBSCEditorFlag,    // kSDKDefVisibleInKBSCEditorFlag or kSDKDefInvisibleInKBSCEditorFlag.

        kDocWchActionComponentBoss,

        kDocWchUseResponderActionID,       

        kDocWchUseResponderMenuItemKey,       

        kOtherActionArea,           

        kNormalAction,               

        kCustomEnabling|kDisableIfLowMem,   

        kInvalidInterfaceID,       

        kSDKDefInvisibleInKBSCEditorFlag,               

    }   

    };//End ActionDefs for DocWch   

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

to setup an own menu with actions and to be able to react on the ation invocing oft some (standard) applications mein menu items I need the information hoe to code the two MrnuDef- and two ActionDef-blocks at my single UIE.fr-file, if that is generally posible.

Or should I implement two (or more) fr-files ans include all them at TriggerResourcesDeps.cpp?

As I told you, we have had implmented a similar plug-in (with CS2) nearly 10 years ago, which was lost.

As I remember, we used another aproach to get signaled from the main menu File:Save-actions.

That another probably would avoid the current problem.

May you let me know, how to get the Adobe applications actionManager and its ActionComponent as well?

Kind regrads

Jochen

Votes

Translate

Translate

Report

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
Community Expert ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Hi Jochen,

I did look at your code but could not find any issues straightaway, and surely you can implement ActionDef and MenuDef in the same .fr file. I would advice you two things

  • Try commenting parts of your .fr file to isolate precisely which code is giving you errors
  • Play around with a sample InDesign sdk plugin that creates menu, try and understand that code and the compare it with your to identify the problem.

Sitting remotely i can't really give much hints on the specifically what might be the issue. The only point that i can say for sure is that you can achieve what you need(as told here), with the recommendation i and other members have given here.

-Manan

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Hi Manan,

the question is not the implementation of MenuDef and ActionDef-bocks at a single fr-file, but the Menu-definition and the Action-definition for two or more menus at a single fr-file.

I could not get it working.

So I've used my own UIE.fr to implement the additional own UNI.SEL.FLOW menu and the DocWch.fr-file to implement the functionality to get signaled from the document saving.

My Plug-In can now build succesfully, but I can not get any reaction from the File:Save-actions, allthough I've implemented CAlerts at the DocWchActionComponent, DocWchServiceProvider aan at the DocWchResponder at nearly all the logical branches.

There is no Alert shown at any stage.

Could you let me know from which startpoint the class instance for the plug-in are created/instanciated.

I've searched for files containing DocWchFactoryList.h or UIEFactoryList.h without a result.

As I do not get any error and any alert, I 'm slightly confused.

Please let me know, if my approach with the two fr.file may work at all and if not how to get the creation of an own menu can be combined with the signaling from the Application File:Save-actions.

Jochen

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Hi Manan,

I've now incuded the DocWch.fr file into my UIE.fr-file.

After fixing all the errors, the main problem is quite clear.

Du to the repeating of the resource names at the two fr files, 'duplicate ressources errors are thrown.

That means that two fr-files caan not be used at a single plug-in.

Am I right?

So the question, how to combine the creation of an additional menu with the logic to get informed, when the actual file was saved, is still not answerded.

Either there is a possibility to bind the menu definition of multiple additional menus and existing menus of interest within a single MenuDef-Block and action definition of theswe multiple menus within a single ActionDef-block, or there is a way to connect to the applications ActionCompoment (or ActionManager) to ask him/them to notify my code about the saving of the current document.

At a similar plug-in, we hade build about ten years ago, we used suddenly the lastly named approach.

But that project was lost unfortunately.

We urgently ned help!

Jochen

Votes

Translate

Translate

Report

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 ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

A plugin can have multiple resources of the same kind if you use different resource IDs. Not just the symbolic names, but also the underlying value.

Back in the old days a project could also have multiple fr files at top level. Later on Adobe intentionally broke the fr compiler so you have to use #include. While it is possible to work around Adobe's broken compiler, in your case I'd say stick with the #include, as it is used all over the SDK examples. The term "umbrella file" is used for a top level fr file that includes the others.

On the other hand you can put any number of action definitions and menu items into the same resource (per kind), that double curly brake notation indicates a variable sized array. If you have not yet realized the pattern, action definitions have 8 values each, starting with the - your! - action component boss class. Menu definitions have 4 starting with the action ID. The path - where the action shows up in the menu - is second value of each menudef, so you can also target any number of menus from within the same resource.

This is not related to how a newly defined menu item is handled by its responsible action component - again there are enough examples in the SDK. The typical approach is to start with a working example, modify it until it breaks, curse, then undo the last step. I'd suggest for that task you start with the basicmenu example, and move the resource definitions (source code) to your plugin when they work.

Regarding the file operation notification, it depends on your intention: If you want to intercept and modify the general behavior of saving, e.g. in order to disable the save menu item, upload the file to own backend, use that IID_IDOCFILEHANDLER approach I mentioned in a different thread, referring to the archives. It is closer to the actual file level menu action as you were asking back then.

Otherwise take the simpler approach, thanks to Manan for bringing that up. If you do time tracking, logs, last minute updates to the document model on save, early updates on new/open, render previews - use the signal / responder. Again, search the SDK for any "...DocSignalResponder..." - I get almost 100 hits even in CS2 SDK.

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Hi Dirk,

thanks for your repy.

As I wrote already, we have had implemenmted a similar pliug-in nearly 10 year ago, which was lost unfortunately.

At that Plug-In we had added an own menu and have got the signals from File:Save-actions.

As I remember we used the application ActionManager  to get signaled.

At the moment I followed the recommendations and have tryed to use one MenuDef and one ActionDef-block to get both functionalties working.

But the worked for me and the two fr-files do not work as well.

So I ask you again, what ist the way to get the signals from the main menu File:Save-actions without the need to use MenuDef and ActionDef for that approach.

Kind regards

Jochen Seliger

Votes

Translate

Translate

Report

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 ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Implementing own menus and menu items is one topic, doing something on file activities is a different topic. You are mixng them up confusing yourself. Solve one problem after the other. The approach is the same: use appropriate examples from the sdk. Search the mentioned keywords. Compile and run. Add small changes, if anything breaks, undo and try to understand why it broke.

Besides we are running in circles. You have repeatedly told your history, run into obstacles at basic levels, asked different vague questions at an advanced level, we have pointed you to the same solutions.

Beyond that we all have to do our own homework. I admire the patience of Manan, maybe you can hire him for the project? If he has the spare time ...

Votes

Translate

Translate

Report

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
Community Beginner ,
Jul 21, 2016 Jul 21, 2016

Copy link to clipboard

Copied

Hi Dirk,

again I ask you for a way to get informed, when the actual document was saved.

I remember that we've had the solution through the object instances created by the Adobe application. at our 'old' plug-in.

But now I can not find a way to get the ActionComponent for the 'File' menu at ISession, ICommandManager, IActionManager and IMenuManager,

May you let me kow, what's the name of that ActionComponent or how to retrieve it from the application and its related objects.

If I could add the respective ActionID via the ActionManager to that ActionComponent I hope to get, what I want.

Kind regards

Jochen Seliger

Votes

Translate

Translate

Report

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 ,
Jul 21, 2016 Jul 21, 2016

Copy link to clipboard

Copied

To get informed when the document was saved, use kAfterSaveDocSignalResponderService.

No menus, no actions.

For completeness, you may cover other cases such as kAfterSaveAsDocSignalResponderService.

Search the SDK for those keywords, there are plenty examples.

Votes

Translate

Translate

Report

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
Community Beginner ,
Sep 23, 2016 Sep 23, 2016

Copy link to clipboard

Copied

Hi Dirk,

as I've stated already the kAfterSaveDocSignalResponderService is raised to late for my request.

As I remember that we did not use any other package than the XML-Parse when buildig a similar Plug-In severela xears ago, I've inspected the involved interfaces, starting with the gsession.

At the sessionsChangeManager I fond a function AddDependency(ISubject* subject, IObserver* observer,    const PMIID& observerIID, const PMIID& interestedIn).

It seems to me , that this function may be used to attach my own observer to the 'File'-menu, in case I know the subject of the menu and the PMID of the two sub-items.

May you provide me these values?

Kind regards

Jochen Seliger

Votes

Translate

Translate

Report

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
Community Expert ,
Jul 21, 2016 Jul 21, 2016

Copy link to clipboard

Copied

Hi Jochen,

I know that its urgent for you to fix this, but asking the same question to different people would not change the answer. I see the discussion moving in a loop and answers being repeated, but you are not able to get things sorted out. The last pointer that Dirk gave you was already provided to you quite early in the discussion and then you added some more requirements and the discussion changed route, now again you are back to square one.

I would highly recommend that you please go through the hints provided in the discussion, look at the SDK samples and work your way out. Trust me there is no more information that you need at this point to resolve this problem of yours, the only thing that you need is to be observant of why your code fails and the SDK sample does not. This is the only thing that you need to put in place, rest you have all the info.

I hope you get the thing sorted out soon

-Manan

Votes

Translate

Translate

Report

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
Community Beginner ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Hi Dirk,

as our Plug-In shall handle the interaction between the calling work item of our ad production work flow solution and the InDesign-Application, we will have to save the files in any case to different folders (into our mobile order cases).

As the DocWch signals aare not quite good synchronized with the standard SAVE-procedure and I can not find a way to edit the internal path-variable (whicch is controlling if the 'Save As' dialog shall be shown or not, I want to get signaled from the InDesign 'File:Save' and the 'FILE:Save As' menues.

So no IID_IDOCFILEHANDLER nor searching for "...DocSignalResponder..." seems to be the right way for me.

Obviusely I should get the ActionComponent of the two menues, and/or their MenuManagers.

May you give me a tip how to do?

Kind regards

Jochen

Votes

Translate

Translate

Report

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 ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

IID_IDOCFILEHANDLER is the interface ID of IDocFileHandler. When you search for that, you will find among others:

Re: stop the close of active document...CS3

Re: Override default save indesign dialog on closing an unsaved doc

Votes

Translate

Translate

Report

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
Community Beginner ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

While testing/implementing code to geet signaled from Main-menu at my UIE.PLN I got ydeserday firts the message at InDesign-Startup 'UIE.PLN does conflict with UIE.PLN.

Some times later InDesign started to claim 'Adobe InDesign does not recignice UIE.PLN as a vald plug-in'.

This plug-in I could build with 4.0.2 SDK and run with CS2 for several months.

The Diagnostics plug-in is not present at my system.

How to avoid that error?

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

The conflict message comes when one of the following might be happening

  • You have two copies of the same plugin placed in the Plug-Ins folder or the location from where you are loading the plugins and hence they clash as every plugin must have a unique plugin prefix.
  • The plugin prefix you used is clashing with one of the installed plugins, try with changing your plugin prefix in the code.

Regarding the problem of plugin not recognised, it generally occurs if the plugin is not properly compiled and installed. Like for example the resources are not compiled properly. Rebuild your plugin, if it works generally, and retry installing it.

-Manan

Votes

Translate

Translate

Report

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
Community Beginner ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

Hi Manan,

that plug-In I'v in my hands since 8 or 9 moths,

Therefor I'v got a prefix from Adobe.

This plug-In I could build successfully for several moths.

I was trying to get the signals from Main:File Save menu, by implementing an UIEIObserver-Class.

Two days ago ID CS2 claimed first UIE.PLN is conflicting with UIE.PLN and several hours later the message was and is 'Adobe InDesign does not recognice UIE.PLN as a valid plug-in.'

Meanwhile I've outcommented all the added lines, concerning my UIEIObserver, and have even excludet that class from my project, but nothig changed.

Further I've repaired my InDesing-Installation without any success

I'v not changed the prefix an nothing else  at my host and at my ID installation.

The UIE.PLN is contained only in a single USF folder.

So what could cause the the wrong 'conflicting' message and what my cause the current failure.

Votes

Translate

Translate

Report

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
Community Beginner ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

Hi Manan,

I'v now installed a further XP VM on another host and istalled there ID CS2 again.

It shows the same error message.

The Diagnistics.apln is not installed on my machine.

How my I find out, what gone wrong with my plug-In?

Votes

Translate

Translate

Report

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