Category: Scripting

Remove Tags From HTML with RegEx

January 11, 2010 by Marcus Tettmar in Scripting

A quick and easy way to remove HTML tags from a string: Let>Html=Hello WorldTest link Let>pattern= RegEx>pattern,Html,0,matches,numMatches,1,,plainText MessageModal>plainText

Read more »

How to Sort a CSV File

November 5, 2009 by Marcus Tettmar in Automation, Scripting

This morning, forum user hip asked how a script could sort a CSV file. Seems CSV files, sorting and Excel has become a bit of a hot topic here lately. Since Excel can read and save to CSV and also has a Sort function we might as well make use of it. Here’s a little […]

Read more »

Convert XML to CSV

October 30, 2009 by Marcus Tettmar in Automation, Scripting

Earlier this month I wrote about how you can read and write data from/to CSV files as if they were database tables using DBQuery. Andrew asked if I knew of a way that XML files could be treated as database tables in the same way. I did find a couple of references to some ODBC […]

Read more »

Randomly Shuffle an Array

October 28, 2009 by Marcus Tettmar in Scripting

I was recently asked how to get a list of files from a folder, and then randomly shuffle that list. The following code retrieves the list of files to an array using GetFileList and Separate and then loops through the array shuffling it randomly: GetFileList>c:\docs\*.*,file_list Separate>file_list,;,files_array If>files_array_count>0 //randomize the array Let>k=0 Repeat>k Let>k=k+1 Random>{%files_array_count%-1},random_index Let>random_index=random_index+1 […]

Read more »

More on Reading and Writing CSV Files

October 5, 2009 by Marcus Tettmar in Scripting

More on Reading from CSV Files In Reading from CSV Files I showed you how you could read an entire CSV file into an array of rows and columns. It used a SELECT * SQL statement to retrieve the entire table. If you just want to read in a specific set of data you could […]

Read more »

Including Often Used Library Files

September 9, 2009 by Marcus Tettmar in Scripting

If you create lots of Macro Scheduler macros you probably have pieces of code you use frequently. You might have blocks of VBScript or subroutines you often use in your macros. Copying and pasting code like that into your scripts is time consuming and also means if you ever need to change that code you’ll […]

Read more »

Determine IE Version and Automate IE Dialogs

August 28, 2009 by Marcus Tettmar in Automation, Scripting

If you are automating web pages or web applications you may at some point need to automate dialog boxes produced by client side script, like the one that pops up when you click the link below: Confirm Popup So you might want to be aware that the title of these popups varies between different versions […]

Read more »

The Power of DOS: Looping Through Subfolders

August 25, 2009 by Marcus Tettmar in Automation, Scripting

Twice today, for two different people, I needed to write some code to iterate through files in a tree of subfolders. The subfolder structure could not be known up front and there may be any number of subfolders and any number of folders deep. One could use GetDirList iteratively, or use VBScript’s FileSystem Object. But […]

Read more »

Find and Click on Screen Text with MODI

August 11, 2009 by Marcus Tettmar in Automation, Scripting

Gale Dyvig has just posted some code in the forums showing how to use the Microsoft Office Document Imaging OCR component to locate text on the screen, find its position and click on it. Very useful. You’ll find it here. MODI is a component that comes with Microsoft Office. You need to ensure Microsoft Office […]

Read more »

Selecting from a Drop Down List

July 2, 2009 by Marcus Tettmar in Automation, Scripting

A project I’m currently working on involves populating data into a rather poorly designed user interface.  A particular challenge were the drop down lists and list boxes due to the fact that you can’t “drill down” by sending the text of the item you want selected. The solution we settled upon uses the text capture […]

Read more »