Get macro text or other property

Syntax

s.getmacro([macro|iid] [flags])

 

Parts

s - str variable.

macro - name of a macro or other item. Default: "" (item that is currently open in editor).

iid - QM item id. Integer.

flags - one of the values listed below. Default: 0.

0 get text.
1 get name.
2 get trigger. It is encoded trigger string. It consists of trigger (possibly with escape sequences), programs and trigger filter function. To get parsed components or description, use qmitem.
3 get type. s will be "0" if the item is macro, "1" if function, "2" if menu, "3" if toolbar, "4" if T. S. menu, "5" if folder, "6" if member function, "7" if file link.
4 get disabled state. s will be "1" if the item is disabled, or "0" if not.
5 get encrypted state. s will be "1" if the item is encrypted, or "0" if not.
6 get shared state. s will be "1" if the item is in a shared folder, or "0" if not.
7 get id.
8 get read-only state. s will be "0" if the item is not read-only, "2" if the item is encrypted, "1" if the item is in read-only folder and not encrypted.

 

Remarks

Gets macro text or some other property. If macro or iid is invalid, generates run-time error.

 

If macro begins with \, it is interpreted as path. For example, if you want to get macro "Next", which is in "Mouse" folder, then it can be "\Mouse\Next".

 

Examples

str s ss
s.getmacro("Untitled")
ss.getmacro("\Folder\Macro")

int i = qmitem("Untitled")
_s.getmacro(i)