Guide on Configuring Settings Within Macros Using EmEditor Text Editor

Guide on Configuring Settings Within Macros Using EmEditor Text Editor

Andrew Lv8

Guide on Configuring Settings Within Macros Using EmEditor Text Editor

September 14, 2009 at 11:49 pm #7639

Yutaka Emura

Keymaster

dw7832 wrote:
I’m currently struggling to set the properties of the active configuration of a file in a macro:

// toggle show spaces
if (document.Config.Mark.ShowSpaces) {
document.Config.Mark.ShowSpaces = false;
} else {
document.Config.Mark.ShowSpaces = true;
}

and

with (document.Config.Indent) {
TabColumns = 4;
InsertSpaces = true;
WrapIndent = true; }
document.Config.Save();

Neither of these give an error message but when alert()-ing the properties they are not changed nor does EmEditor act like they’ve changed. Can anybody shed any light?

Thank you in advance.

Please try this way:

cfg = document.Config;  

if (cfg.Mark.ShowSpaces) {  

cfg.Mark.ShowSpaces = false;  

} else {  

cfg.Mark.ShowSpaces = true;  

cfg.Save();

Also read:

https://techidaily.com
  • Title: Guide on Configuring Settings Within Macros Using EmEditor Text Editor
  • Author: Andrew
  • Created at : 2024-11-11 00:04:41
  • Updated at : 2024-11-12 18:03:17
  • Link: https://win-latest.techidaily.com/guide-on-configuring-settings-within-macros-using-emeditor-text-editor/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Guide on Configuring Settings Within Macros Using EmEditor Text Editor