Creating and Editing a Macro

www.altova.com このトピックを印刷 前のページ 1つ上のレベル 次のページ

ホーム >  プログラマーの レファレンス > Scripting Editor > Macros >

Creating and Editing a Macro

The following operations enable you to create a new macro and edit an existing macro.

 

 

Creating a new macro

Right-click the Macro folder in the Scripting Projects tree and select Add Macro from the context menu. (The Add Macro command can also be selected from the context menu of any item in the Scripting Projects tree.) Alternatively, click the New Macro icon in the toolbar of the Scripting Projects tree.

 

The newly created (and empty) macro document is displayed in the Main Window, and the name of the macro is displayed in the title bar of the Scripting Editor (screenshot below).

 

ScrMacroTreeSV

 

 

Naming or renaming a macro

To name or rename a macro, click the macro name in the Scripting Project tree and press the F2 function key, or right click the name and select Rename from the context menu.

 

 

Opening a macro

To open a macro, right-click the macro in the Macros folder of the Scripting Project tree (see screenshot above), and select the Open command. The macro is displayed in the Main Window and its name is displayed in the title bar of the Scripting Editor (screenshot below). Alternatively, double-clicking a macro in the Scripting Project tree opens it in the Main Window.

 

 

Editing the macro

To edit a macro, enter or edit its code in the Main Window. For example, the following code creates the Form named Form1 in memory and then shows it. Form1 must already have been created (using the Scripting Editor's Form creation) before this macros is run.

 

objForm = CreateForm( 'Form1' );

objForm.ShowDialog();

 

Note:Macros do not support parameters or return values.

 


(C) 2019 Altova GmbH