LaTeX forum ⇒ WinEdtWinEdt Macro: Select Text to first SPACE

Information and discussion about WinEdt, a commercial integrated LaTeX environment for Windows
Dzaic
Posts: 1
Joined: Wed Jun 15, 2016 2:08 pm

WinEdt Macro: Select Text to first SPACE

Postby Dzaic » Wed Jun 15, 2016 2:25 pm

Hello

First I would like to apologize for my english.

I would like to learn the makro language included in WinEdt. For this purpose I have choosen an "easy" task:

- Replace the text to the left of the cursor by \ac{TEXT} if the characters ".-" are entered.

So far, so good. I have added the following Active String

  1. STRING=".-"
  2. ENABLED=1
  3. MODE_FILTER="TeX"
  4. MACRO="[Exe('%b\Macros\Active Strings\Acronym.edt');]"


My current status of the file Acronym.edt is as follows:

  1. // -*- ASCII:EDT -*-
  2. // Active String for \ac{}
  3.  
  4. Backspace(2);
  5. SelWordLeft(1);
  6. UpperCase;
  7. InsText('\ac{%S}');


My problem is, that I don't know, how to expand the selection to the first space-character to the left of the cursur.

Example:

ab.- expands well do \ac{AB}, but ba-aa expands to ba-\ac{AA} instead of \ac{BA-AA}.

Tags:

Return to “WinEdt”

Who is online

Users browsing this forum: No registered users and 1 guest