Skip to content

Commit

Permalink
Fix macro codeblocks (#40)
Browse files Browse the repository at this point in the history
* dom

* msgbox

* regread

* run_app

* username
  • Loading branch information
MakotoE authored Nov 13, 2023
1 parent eb229d1 commit 7b77f0f
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 107 deletions.
6 changes: 3 additions & 3 deletions en/macro/tutorial/tutorial_dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ document.write("EmEditor supports macros.");
```
document.write "EmEditor supports macros."
```
Either of the above examples produces the same result; the behaviors of[Text Property](../selection/selection_text) and that of[write Method](../document/document_write) are identical.
Either of the above examples produces the same result; the behaviors of [Text Property](../selection/selection_text) and that of [write Method](../document/document_write) are identical.
You can use multiple objects in EmEditor macros. We designed the macros this way to achieve Object-Oriented Programming
(OOP)
as well as to allow extensibility and to accommodate future enhancements of the macros,
Expand All @@ -30,9 +30,9 @@ You can use the following objects in EmEditor macros:
- [Window Object](../window/index) \-
becomes the default scope, and thus, there is no need to specify object names.
It provides methods and properties of Windows user interfaces. The[document \
Property](../window/window_document) allows you to use properties and methods of[Document Object](../document/index)
Property](../window/window_document) allows you to use properties and methods of [Document Object](../document/index)
for the current document. Also, the[editor \
Property](../window/window_editor) allows you to access[Editor Object](../editor/index).
Property](../window/window_editor) allows you to access [Editor Object](../editor/index).
- [Document Object](../document/index) \-
provides methods and properties for opened documents,
which applies to elements of the overall document and includes details about a file, such as the file name of the document,
Expand Down
3 changes: 2 additions & 1 deletion en/macro/tutorial/tutorial_msgbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ The variable n is assigned the value 6 if YES button is selected, 7 if NO button

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

n = WshShell.Popup( "Continue?", 0, "EmEditor", 3 );
```

### \[VBScript\]

Expand Down
7 changes: 3 additions & 4 deletions en/macro/tutorial/tutorial_regread.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ The following example code reads the file name of a running macro from the regis

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile"
);

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile");
alert( str );
```

### \[VBScript\]

Expand Down
25 changes: 4 additions & 21 deletions en/macro/tutorial/tutorial_run_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,36 @@ The following example code runs the Windows calculator and sends it keystrokes t

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

WshShell.Run( "calc.exe" );

Sleep( 1000 );

wnd = shell.FindWindow( "", "Calculator" );

wnd.SetForeground();

shell.SendKeys( "1" );

Sleep( 100 );

shell.SendKeys( "{+}" );

Sleep( 100 );

shell.SendKeys( "2" );

Sleep( 100 );

shell.SendKeys( "=" );
```

### \[JavaScript (V8)\]

```
shell.Run( "calc.exe" );

Sleep( 1000 );

wnd = shell.FindWindow( "", "Calculator" );

wnd.SetForeground();

shell.SendKeys( "1" );

Sleep( 100 );

shell.SendKeys( "{+}" );

Sleep( 100 );

shell.SendKeys( "2" );

Sleep( 100 );

shell.SendKeys( "=" );
```

### \[VBScript\]

Expand Down
3 changes: 2 additions & 1 deletion en/macro/tutorial/tutorial_username.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ The following example demonstrates how to get the name of a current computer use

### \[JavaScript (JScript)\]

```
WshNetwork = new ActiveXObject( "WScript.Network" );

alert( "User Name = " + WshNetwork.UserName );
```

### \[VBScript\]

Expand Down
3 changes: 2 additions & 1 deletion ja/macro/tutorial/tutorial_msgbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

n = WshShell.Popup( "Continue?", 0, "EmEditor", 3 );
```

### \[VBScript\]

Expand Down
7 changes: 3 additions & 4 deletions ja/macro/tutorial/tutorial_regread.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile"
);

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile");
alert( str );
```

### \[VBScript\]

Expand Down
21 changes: 4 additions & 17 deletions ja/macro/tutorial/tutorial_run_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,32 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

WshShell.Run( "calc.exe" );

Sleep( 1000 );

WshShell.SendKeys( "1" );

Sleep( 100 );

WshShell.SendKeys( "{+}" );

Sleep( 100 );

WshShell.SendKeys( "2" );

Sleep( 100 );

WshShell.SendKeys( "=" );
```

### \[JavaScript (V8)\]

```
shell.Run( "calc.exe" );

Sleep( 1000 );

WshShell.SendKeys( "1" );

Sleep( 100 );

WshShell.SendKeys( "{+}" );

Sleep( 100 );

WshShell.SendKeys( "2" );

Sleep( 100 );

WshShell.SendKeys( "=" );
```

### \[VBScript\]

Expand Down
3 changes: 2 additions & 1 deletion ja/macro/tutorial/tutorial_username.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

### \[JavaScript (JScript)\]

```
WshNetwork = new ActiveXObject( "WScript.Network" );

alert( "User Name = " + WshNetwork.UserName );
```

### \[VBScript\]

Expand Down
3 changes: 2 additions & 1 deletion zh-cn/macro/tutorial/tutorial_msgbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

n = WshShell.Popup( "Continue?", 0, "EmEditor", 3 );
```

### \[VBScript\]

Expand Down
7 changes: 3 additions & 4 deletions zh-cn/macro/tutorial/tutorial_regread.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile"
);

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile");
alert( str );
```

### \[VBScript\]

Expand Down
25 changes: 4 additions & 21 deletions zh-cn/macro/tutorial/tutorial_run_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,36 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

WshShell.Run( "calc.exe" );

Sleep( 1000 );

wnd = shell.FindWindow( "", "Calculator" );

wnd.SetForeground();

shell.SendKeys( "1" );

Sleep( 100 );

shell.SendKeys( "{+}" );

Sleep( 100 );

shell.SendKeys( "2" );

Sleep( 100 );

shell.SendKeys( "=" );
```

### \[JavaScript (V8)\]

```
shell.Run( "calc.exe" );

Sleep( 1000 );

wnd = shell.FindWindow( "", "Calculator" );

wnd.SetForeground();

shell.SendKeys( "1" );

Sleep( 100 );

shell.SendKeys( "{+}" );

Sleep( 100 );

shell.SendKeys( "2" );

Sleep( 100 );

shell.SendKeys( "=" );
```

### \[VBScript\]

Expand Down
3 changes: 2 additions & 1 deletion zh-cn/macro/tutorial/tutorial_username.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

### \[JavaScript (JScript)\]

```
WshNetwork = new ActiveXObject( "WScript.Network" );

alert( "User Name = " + WshNetwork.UserName );
```

### \[VBScript\]

Expand Down
3 changes: 2 additions & 1 deletion zh-tw/macro/tutorial/tutorial_msgbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

n = WshShell.Popup( "Continue?", 0, "EmEditor", 3 );
```

### \[VBScript\]

Expand Down
7 changes: 3 additions & 4 deletions zh-tw/macro/tutorial/tutorial_regread.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile"
);

str = WshShell.RegRead( "HKCU\\\Software\\\EmSoft\\\EmEditor v3\\\Common\\\MacroFile");
alert( str );
```

### \[VBScript\]

Expand Down
25 changes: 4 additions & 21 deletions zh-tw/macro/tutorial/tutorial_run_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,36 @@

### \[JavaScript (JScript)\]

```
WshShell = new ActiveXObject( "WScript.Shell" );

WshShell.Run( "calc.exe" );

Sleep( 1000 );

wnd = shell.FindWindow( "", "Calculator" );

wnd.SetForeground();

shell.SendKeys( "1" );

Sleep( 100 );

shell.SendKeys( "{+}" );

Sleep( 100 );

shell.SendKeys( "2" );

Sleep( 100 );

shell.SendKeys( "=" );
```

### \[JavaScript (V8)\]

```
shell.Run( "calc.exe" );

Sleep( 1000 );

wnd = shell.FindWindow( "", "Calculator" );

wnd.SetForeground();

shell.SendKeys( "1" );

Sleep( 100 );

shell.SendKeys( "{+}" );

Sleep( 100 );

shell.SendKeys( "2" );

Sleep( 100 );

shell.SendKeys( "=" );
```

### \[VBScript\]

Expand Down
Loading

0 comments on commit 7b77f0f

Please sign in to comment.