Huditsch, Roman (LNG-VIE) wrote:
> 
> Unfortunately, that is not quite what I needed.

I don't know what you need.



> I just want to copy the replaced text to the clipboard. The pasting is done 
> in an extra step.
> My problem is that the copyChar command is ignoring the replacement done by 
> the "get" expression. 

That's normal. See the documentation of the copyChar command
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/copyChars.html



> If I change 
> 
> <command name="Test">
>    <macro>
>      <sequence>
>        <test expression="string-length($selectedChars) &gt; 0 and
>                          contains($selectedChars, '.')" />
>        <get expression="replace($selectedChars, '\.', '. ')" />
>        <command name="paste" parameter="to %_" />
>      </sequence>
>    </macro>
> </command>
> 
> To 
> 
> <command name="Test">
>    <macro>
>      <sequence>
>        <test expression="string-length($selectedChars) &gt; 0 and
>                          contains($selectedChars, '.')" />
>        <get expression="replace($selectedChars, '\.', '. ')" />
>        <command name="copyChars" parameter="%_" />
>      </sequence>
>    </macro>
> </command>
> 
> I just get the selected characters without the additional whitespace in my 
> clipboard.

What about (still don't know what you need, just guessing):

<command name="Test">
    <macro>
      <sequence>
        <test expression="string-length($selectedChars) &gt; 0 and
                          contains($selectedChars, '.')" />
        <set variable="clipboard"
             expression="replace($selectedChars, '\.', '. ')" />
      </sequence>
    </macro>
</command>

(Disclaimer: I've not tested the above command.)





Reply via email to