InDesign Library - Block Addition of Frames
Hi,
I want to block addition of frames to InDesign Library. (*.indl).
I am observing kSnippetBasedCatalogBoss and catpure the command kLibraryAddItemCmdBoss with message kBeforeDoMessageBoss.
From kLibraryAddItemCmdBoss, I am able to identify which frames are being added by the user and I can decide whether to block the addition of frames or not.
From Observer, I set ErrorUtils::PMSetGlobalErrorCode(kCancel) when kLibraryAddItemCmdBoss && kBeforeDoMessageBoss command is executed.
The above method works and it doesn't allow frame to be added in Library.
But then it display the following message as shown in the screenshot -

I don't want any message to be displayed.
I also tried the following -
1. With kLibraryAddItemCmdBoss, we have ICopyCmdData interface, from where I get IDataExchangeHandler and call IDataExchangeHandler->Clear().
InDesign still displays the error message.
2. I added my own error ErrorStringService and passed my own error in ErrorUtils::PMSetGlobalErrorCode(kMyErrorCode) but then InDesign Crashes.
Am I observing correct boss class kSnippetBasedCatalogBoss and obsering right command kLibraryAddItemCmdBoss ?
Can anyone help me on this ?
Regards,
Rahul Rastogi
