Category: Scripting

Sending/Retrieving Emails via Gmail

October 3, 2012 by Marcus Tettmar in Automation, Scripting

Since version 13.2 Macro Scheduler‘s email functions now support SSL. Google’s Gmail and many other email services now insist on SSL secured connections. To use SSL you first need to install the OpenSSL library files. Here’s an example of sending an email via Gmail: Let>SMTP_AUTH=1 Let>[email protected] Let>SMTP_PASSWORD=your_password Let>SMTP_PORT=465 Let>SMTP_SSL=1 SMTPSendMail>[email protected],smtp.gmail.com,[email protected],your name,test,hello world, And to retrieve […]

Read more »

Retrieving all Items and Indexes from a Listbox

July 26, 2012 by Marcus Tettmar in Announcements, Scripting

Some people have reported issue with the GetListItem command failing to work with some applications. While we investigate the issues we’ve created a small workaround. This is a .Net tool called ListInspector. It’s a command line tool which you can pass a listbox handle to and it will dump out a list of all the […]

Read more »

Sorting a String

June 25, 2012 by Marcus Tettmar in Scripting

In the forums this morning PepsiHog asked for some code to sort a string of numbers. We have a built-in method for sorting arrays. But here we want to sort a string of characters. E.g. we want the string “4731” to end up as “1347”. I ended up writing a reusable subroutine which will sort […]

Read more »

Getting into the Zone

April 18, 2012 by Marcus Tettmar in Scripting

Over on the forums JRL asks how to get into the “Programming Zone” and once there how do you stay in it and cope with distractions and interruptions? Any tips? Add your thoughts and suggestions to the topic.

Read more »

Sending Keys to Invisible or Unfocused Windows

March 27, 2012 by Marcus Tettmar in Automation, Scripting

Can you send keystrokes to invisible or unfocused windows? The answer is yes, if the control you want to send the keystrokes into is a “windowed control”. That is, one that has a handle. If that’s too technical just try using the “Send Keys to Object Wizard” in Macro Scheduler 13 which generates code that […]

Read more »

How long does xyz take?

February 3, 2012 by Marcus Tettmar in Scripting

Need to measure how long a process or a set of commands in your script takes? We used to have to do this with VBScript’s Timer function. As of v13 Macro Scheduler has it’s own Timer function. Timer>result Returns the number of milliseconds that have elapsed since the script was started. So let’s say we […]

Read more »

Get Internet IP Address

June 29, 2011 by Marcus Tettmar in Scripting

If you are connected to the Internet here’s an easy way of getting your public IP address by visiting checkip.dyndns.org: HTTPRequest>http://checkip.dyndns.org/,,GET,,HTMLResponse RegEx>[IPAddress],HTMLResponse,1,ips,num_ips,0 If>num_ips>0 MessageModal>Your IP is %ips_1% Else MessageModal>Error retrieving IP from checkip.dyndns.org Endif

Read more »

Calling Macro Scheduler Functions from PowerShell

June 13, 2011 by Marcus Tettmar in General, Scripting

Further to my post about the MacroScript SDK the other day, here’s an example of loading the MacroScript SDK COM object from PowerShell and running some Macro Scheduler code: $objMS = new-object -comobject “mscript.macroscript” $objMS.Init() $objMS.RunCode( “Run>notepad.exe” + [Environment]::NewLine + “WaitWindowOpen>Untitled – Notepad” + [Environment]::NewLine + “Wait>0.5” + [Environment]::NewLine + “Send>Hello World”, “”) $objMS.Cleanup() You […]

Read more »