Category: Scripting

Paste Into Object Without Using Keystrokes

April 17, 2013 by Marcus Tettmar in Automation, Scripting

Someone asked today how it might be possible to paste what is in the clipboard into an object using Macro Scheduler without having to use keystrokes. It can be done by sending the WM_PASTE message using the SendMessage API function. Here’s an example: //Sending WM_PASTE to an object causes a clipboard paste, like sending CTRL-V […]

Read more »

Getting Data From Excel Without Office Installed

March 27, 2013 by Marcus Tettmar in Automation, Scripting

In this post from 2008 I demonstrated how to get data from Excel worksheets using Macro Scheduler’s database functions. This works fine if Office is already installed on the PC.   But what if you want to get data from an Excel sheet and the PC you are running on doesn’t have Office installed? Well […]

Read more »

How to tell if the current session is a Remote Desktop session

January 24, 2013 by Marcus Tettmar in Automation, Scripting

Here’s a small piece of code which will tell you whether the current session is a Remote Desktop/Terminal Services session or not: Let>SM_REMOTESESSION=4096 LibFunc>User32,GetSystemMetrics,isRemote,SM_REMOTESESSION If>isRemote>0 MessageModal>Current Session is RDP/Terminal Services Session Else MessageModal>Current Session is Local Session Endif

Read more »

Custom Event Triggers

December 7, 2012 by Marcus Tettmar in Automation, Scripting

Did you know you can make just about any kind of schedule or trigger using Custom Event Triggers? You’ll find the custom trigger option under Macro Properties in the Trigger tab. Parsnipnose3000 has just posted a tip on Custom Event Triggers to the forums, showing how you can have a macro fire based on an […]

Read more »

My Most Used RegEx

October 29, 2012 by Marcus Tettmar in Automation, Scripting

It occurred to me the other day while working on a script for a customer that I use this regular expression frequently: (?<=TOKEN1).*?(?=TOKEN2) It is very useful when parsing information out of web pages, or when finding elements in web pages. What it does is pull out all the text between TOKEN1 and TOKEN2. Those […]

Read more »

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 »