General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion How to automatically paste plain text

  • rhastah

    How to automatically paste plain text

    Participants 3
    Replies 4
    Last Activity 5 years, 6 months ago

    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

    Reply

    Derek Read

    Reply to: How to automatically paste plain text

    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 text does that mean you want it to appear exactly as that in the XML, so the resulting markup would be this: <para>text</para>

    Reply

    rhastah

    Reply to: How to automatically paste plain text

    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?

    Reply

    Derek Read

    Reply to: How to automatically paste plain text

    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.

    Reply

    rhastah

    Reply to: How to automatically paste plain text

    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!!

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support