Discussion:
Shortcut index
Norbert Wermes
2014-04-03 13:38:04 UTC
Permalink
I have a shortcut definition which puts \index{keyword} behind the text "keyword"

// NW defines alt+< key to insert "INDEX" after word on which cursor sits
ITEM="ind"
CAPTION="&ind"
IMAGE="ind"
MACRO="Exe('%b\Menus\Shortcuts\index.edt');"
SHORTCUT="32994::Alt+<"
REQ_DOCUMENT=1

this works ok.

Now I would like to define another shortcut which puts \index{keyword |( } , i.e. initializing a range, but I do not know
what to replace the line

MACRO="Exe('%b\Menus\Shortcuts\index.edt');"

with.
I also would like to define more shortcuts, like for \index{keyword |) } and others.

Thanks,
WinEdt Team
2014-04-03 19:19:37 UTC
Permalink
Norbert,
Post by Norbert Wermes
I have a shortcut definition which puts \index{keyword} behind the text "keyword"
// NW defines alt+< key to insert "INDEX" after word on which cursor sits
ITEM="ind"
CAPTION="&ind"
IMAGE="ind"
MACRO="Exe('%b\Menus\Shortcuts\index.edt');"
SHORTCUT="32994::Alt+<"
REQ_DOCUMENT=1
this works ok.
Now I would like to define another shortcut which puts
\index{keyword |( } , i.e. initializing a range, but I do not know
what to replace the line
MACRO="Exe('%b\Menus\Shortcuts\index.edt');"
with. I also would like to define more shortcuts, like for
\index{keyword |) } and others.
Since macro script index.edt is not included in default settings
you must have either created it yourself or obtained it from
somewhere else. Thus we have no idea what it does (but you
should:-)...

A simple macro:

MACRO="Ins('\index{keyword |)});'"
or
MACRO="BeginGroup;Ins('\index{keyword |}(');EndGroup;"

will insert the specified string at your current position (if
that's what you want).

More sophisticated macro scripts can be executed via. Exe(); but
first you have to create / obtain a macro script that does what you
want otherwise they will just report an error that a script file
does not exist.

Take a look how other (similar) items in Insert menu are defined
and consult the Help if needed (it explains what each macro
function does).

Best regards,

alex

Loading...