Macro Scheduler 15

Send our lines of text


 

Before we send our text, we should note that sometimes, a macro will be too fast for the intended software.  With this in mind, we can control the speed with which characters are sent when using SendText.  We do this with SK_Delay.

 

Thus, the following line will introduce a 20 millisecond delay between each character sent :

 

Let>SK_DELAY=20

 

Now we want to send our text.

 

For this we use the SendText command, commonly abbreviated to just Send:

 

Send>some text

 

To send more than one line we would manually type the text and press enter to move on to the next line, so this would look like this:

 

Send>This is the first line of my notepad file

Press Enter

Send>This is line two

Press Enter

Send>This is the third and final line.

 

But let's be a bit cleverer.  Let's create three lines of text and assign them to variables using the Let command:

 

Let>firstline=This is the first line of my notepad file.

Let>secondline=This is line two.

Let>thirdline=This is the third and final line.

 

Now let's join them together with a carriage return character to ensure the line breaks.  CR is a Macro Scheduler system variable for a carriage return:

 

Let>entiretext=%firstline%%CR%%secondline%%CR%%thirdline%

Send>entiretext

 

The % symbols tell Macro Scheduler that the value within the % symbols is a variable, so it creates a new variable called 'entiretext' made up of the variables firstline, CR, secondline, CR and thirdline all joined together.

 

 

 

Let's test the script so far.  Close any open Notepad windows and run the script:

 

 

Hopefully you ended up with a new Notepad window appearing on your desktop looking like this: