Commands & Syntax > Commands > External Scripts >

www.MacroToolworks.com

Embedded BASIC SCRIPT - < script_basic > ... [Pro]

 

Embedded BASIC SCRIPT
<script_basic>
Available in: Professional edition

This command runs a "Basic Script" script within the macro. It is possible to exchange data between the program native macro language variables and the Basic Script variables. The variable content exchange is done through DDE - see the samples below.

 

 

Example (Macro Steps):

 

1

<#> <#> Count sin(1), put it to clipboard and show it in Notepad

2

Macro execution: ONLY COMMANDS

3

Embedded BASIC SCRIPT \ Sub Main \ s = Sin(1) \ Clipboard s \ End Sub \

4

Run APPLICATION "notepad.exe" (other parameters: Parameters = , Folder path = , Window state = Normal). Macro execution waits for application to finish up to "0" seconds.

5

WAIT FOR Object = "WIN", Event = "OPEN", Parameter = "Notepad", Timeout (seconds) = "5", Exact = "0"

6

Macro execution: KEYS / FREE TEXT + COMMANDS

7

Key Ctrl

8

v

9

Key Ctrl

Example (Plain Text):

 

<#> Count sin(1), put it to clipboard and show it in Notepad

<#>

<cmds>

<script_basic>

Sub Main

s = Sin(1)

Clipboard s

End Sub

</script_basic>

<execappex>("notepad.exe","","",0,0)

<waitfor>("WIN","OPEN","Notepad",5,0)

<keys><ctrl>v<ctrl>