Skip to main content
YogeshDWalke
Participating Frequently
November 21, 2013
Question

How is the text frame cut/copy and pasted

  • November 21, 2013
  • 1 reply
  • 961 views

I have text frames with hidden text in the content.

I am handling the cut/copy/paste of the hidden text by using methods provided in HidTxtMemento.

I know that IScrapSuite can be used to cut/copy/paste the content of a text frame.

But I need to know which interface is used to cut/copy/paste the text frame itself.

Now, when I cut/copy/paste a text frame, the hidden text content is ignored. So, I want that when I copy a text frame, the hidden text content should also get copied and then pasted.

How can I do this?

Any help will be appreciated.

Thank you.

Regards,

Yogesh Walke

This topic has been closed for replies.

1 reply

YogeshDWalke
Participating Frequently
December 3, 2013

Hello,

When we cut a text frame and then paste it, a new uid is assigned to the pasted frame.

Now, I want to know the new uid assigned to the frame each time it is cut/paste.

I tried to search for working of cut/copy/paste operations, but I could only find its implementation at text level (for ex. IScrapSuit uses clipboard to modify text).

It will be really helpful if I find the observer or interface that is used to carry out the operations of cut/copy/paste the text frame.

Hoping for a reply.

Thanks.

Regards,

Yogesh Walke

Legend
December 3, 2013

Your questions mix up multiple areas. Are you having problems with copying the hidden text, which is a part of the text model? It should work with ITextMemento, even though it's been ages that I played with that.

If you really want to watch the text frame, just observe IID_IHIERARCHY_DOCUMENT at kDocBoss.

One change notification (of several) during my test was kNewPageItemCmdBoss, while the command is kCopyPageItemCmdBoss, whose IID_ICOPYCMDDATA's UIDList points to the source frame in scrap - e.g. GetDataBase()/GetClass(GetRootUID()) yields kScrapDocBoss indicating a data transfer such as Copy/Paste or Drag&Drop. I leave as an exercise how to rule out the latter ;-)

IID_ICOPYCMDDATA's root cmd will also be a kPasteCmdBoss.

Some ideas for more complicated test cases: copy paste multiple page items together, some of them grouped, others chained to form a single text story, some of them anchored inline within a surrounding text story.

Dirk

YogeshDWalke
Participating Frequently
December 4, 2013

Thanks Drik,

I got your point. Copying of hidden text is not our problem. Let me explain our scenario in brief.

When user Cut-Paste text frame in InDesign, it deletes original text frame and creates new one. and hence UID of the frame changes.

In our plugin code we persist this UID's (while we create the text frames) and later we use same UID's to identify the text frame in INDD document and update the data in text frame.

Now the problem is if user has cut-paste the frame then that newly created text frames UID is not present in our persist data list (containing all the UIDs of frames). Hence we cant update the frame after user cut-paste it.

Now we want to observe/override Cut-Paste action in InDesign and want to add code which will reassign the old UID to newly created (pasted) frame.

Regards,

Yogesh Walke