Specifying, editing, and running scripts
When you select a script in the tree, a text editor displays the
contents of the script in the data section. you may edit the script. You are
prompted to save the changes, when you select another object in the tree. To
run a script, select the
command on the
shortcut menu of the script.
Note: When you run a VBScript or a JavaScript using the
shortcut menu command
, not only the global
commands and function calls are executed but also the first encapsulated
procedure (sub or function) of the script.
When you run this example of a VBScript, the message
This is a test.
is displayed, whereas the message
Hello World!
is not displayed:
Sub Main()
Test
End Sub
Public Sub Test()
MsgBox "This is a test."
End Sub
Public Sub World()
MsgBox "Hello World!"
End Sub