Pages: 1
Print
Author Topic: How to automatically paste plain text  (Read 271 times)
rhastah
Member

Posts: 3


« on: September 06, 2017, 08:56:17 AM »

Hi all,

This is probably a simple question, but I can't seem to find the answer. All I want to do is set XMetal to always paste plain text only - never try to format anything for me or copy the formatting over from another application.

I just want plain text when I hit ctrl+v.

Anyone know how to do this?

Thanks,
Rhastah
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2513



WWW
« Reply #1 on: September 06, 2017, 01:03:02 PM »

The simplest way to do this is in Plain Text view.

If that is not an option then you will need to live with the paste feature implemented by the customization for the specific DTD you are using and the built-in capabilities of XMetaL Author Essential/Enterprise/XMAX that you are using unless you can have the person that created the customization make changes to it or add the specific feature you want. That will vary greatly depending on which DTD / customization you are authoring to and the exact specifications for what you want to be inserted.

If you implemented the paste capabilities for your customization then you can look at all the various different APIs that XMetaL Author Essential/Enterprise/XMAX implements (search for "paste" in the Programmers Guide) and implement a macro that will do exactly what you want. In almost all cases you are going to want to keep some form of markup, so it is usually not desirable to strip it all away or convert the markup itself into characters that don't result in markup being inserted.

Does "plain text" for you mean to not escape characters such as "<", ">" and "&"?
If you paste something such as <para>text</para> does that mean you want it to appear exactly as that in the XML, so the resulting markup would be this: &lt;para&gt;text&lt;/para&gt;
« Last Edit: September 06, 2017, 01:05:41 PM by Derek Read » Logged
rhastah
Member

Posts: 3


« Reply #2 on: September 18, 2017, 12:36:38 PM »

Thank you for your reply. I will try using the Plain Text view. I've also been encouraged to use Notepad++ or similar to strip the formatting and then paste again. That works too, but it's an extra step.

The situation is sometimes a writer receives source materials in PDF, Word, or some other format and just wants to paste the text into a paragraph, edit/rewrite it, and then re-format it in DITA. The formatting that the Word file or PDF includes is irrelevant, as the writer may want to completely rearrange or rewrite the original text to conform to DITA conventions.

Maybe this could go into feature requests... Just a simple button combination, if ctrl+v is already used, maybe ctrl+shift+v?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2513



WWW
« Reply #3 on: September 18, 2017, 01:56:27 PM »

Yes, we've considered making this a first class feature. However, the number of different requests we have received with specific requirements for such a feature has made it difficult to create something that we feel would work for everyone. Maybe one day.

However, you might consider adding this macro, or making modifications to it and adding your own modified version: http://forums.xmetal.com/index.php/topic,26.0.html

It was written specifically for the DITA authoring functionality, but should work for most other customizations depending on the functionality they have included in their own MCR files associated with the DTD or XSD. This could potentially also conflict with application-level customizations (application-level MCR files). If so, you would likely want to incorporate these few lines of script into those customizations and make them compatible.
« Last Edit: September 18, 2017, 02:00:16 PM by Derek Read » Logged
rhastah
Member

Posts: 3


« Reply #4 on: September 20, 2017, 10:49:25 AM »

It works! Thank you very much, this is exactly what I needed.

Ctrl+Alt+V now pastes more or less plain text, saving me lots of time. Anything that shaves a second or two off a repetitive task can be hugely beneficial.

So thanks again!!
Logged
Pages: 1
Print
Jump to: