January 9, 2009

Quick Tip: Automating Office 2007

Filed under: Uncategorized — Tags: — Marcus Tettmar @ 2:24 pm

Office 2007 does something weird to its window titles. What you see in the window title is not the real internal window title. It’s back to front. E.g. Excel says something like “filename.xls – Microsoft Excel” when in fact the correct title is “Microsoft Excel – filename.xls” just as it always has been. If you look at the task bar icon you’ll see it the right way around. That is what you need to use in your SetFocus/WaitWindowOpen commands etc.

Unicode – Does anyone read release notes?

Filed under: General — Tags: — Marcus Tettmar @ 2:19 pm

Probably the biggest change in Macro Scheduler 11, though not visual, was Unicode support. For Macro Scheduler to support Unicode in scripts it has to save the script files with Unicode encoding rather than ANSI encoding. And if you open a Unicode file up in an ANSI editor it’s going to look garbled. Since older versions of Macro Scheduler were ANSI only and didn’t know anything about Unicode, if you open a v11 script up in v10 (or earlier) that script is going to look wrong.

The v11 release notes have a big warning about this. Nothing is damaged permanently and it doesn’t have any effect on upgrading. It’s only an issue if you edit or create a script in v11 and then, for whatever reason, try to open it in an earlier version. So if, for example, you’re running v11 and you have another PC running v10 and you create a script on your PC and wish to open it on the PC running v10 it’s going to look messed up.

One solution of course is to upgrade that copy of v10 to v11.  But there is another solution. You can tell v11 to save the script with ANSI encoding. From the editor use File/Save As and then in the file type box select “ANSI Script Files”. Alternatively just open the script file up in Notepad and save it again, selecting ANSI in the Encoding box. This of course assumes that you don’t actually NEED Unicode. If you have Unicode characters in your script which you need to use, then clearly saving as ANSI will destroy them. In which case you do need to upgrade that v10 installation to v11.

Macro Scheduler Runs In Windows 7

Filed under: Announcements, General, Macro Recorder, Windows 7 — Tags: — Marcus Tettmar @ 2:05 pm

Whenever Microsoft release a new operating system I’m always a little anxious to make sure we test Macro Scheduler on it as soon as possible and find out what, if anything, needs to be changed. I’ve been following news about Windows 7 for a while now and, reading that it was built on the same core as Vista and Windows 2008, I fully expected Macro Scheduler to run fine on it. But there’s nothing like seeing it in the flesh to be absolutely sure. So when Windows 7 Beta was made available to MSDN subscribers yesterday I didn’t waste much time in downloading it.

Installing Windows 7 into Virtual PC was nice and easy and I’m pleased to say my expectations were right – Macro Scheduler 11 runs absolutely fine.  Everything works as expected, including the macro recorder and even low level stuff like text capturing.  Here’s a screen shot of Macro Scheduler 11 running in my virtual Windows 7 environment:

Macro Scheduler in Windows 7

Macro Scheduler in Windows 7

January 6, 2009

New Year, New Site, New Look, New Logo, New Podcasts

Filed under: Announcements, General, Podcasts — Marcus Tettmar @ 4:29 pm

Happy New Year everyone!

And it’s not just a new year.  Everything else is new too.  Not content with a new release (Macro Scheduler V11) which we got out early in December we felt it was high time for a new look as well.  So along with a nifty new logo we have a new site design, as you will see if you are reading this on the web site.  If not, head on over to www.mjtnet.com and check it out.

There’s one very minor glitch noticeable only if you are using IE6, which is probably the worst web browser ever made.  Unfortunately, amazingly, according to our web server logs 35% of hits come from IE6.  If you are one of those using IE6 ditch it now!  Upgrade to IE7, or, better, try Firefox or Google Chrome if you have to.  Please.  Ok, we’re working on the IE6 issue.  Rant over.

If you spot any broken links, please let me know.

Also new is a series of Macro Scheduler user podcasts.  We thought it would be cool to interview some Macro Scheduler users, find out more about them and how they are benefiting from the software, what kinds of things they’re doing with it.  We figured rather than doing stuffy old case studies it would be more fun to be a bit more informal and create some podcasts.  You’ll find them over on the Customer Testimonial page.   So far there are six podcasts.  You can hear how Mitch Vincent uses Macro Scheduler for automated data input and software testing at K-Software.  Paul Griffin speaks about AppNavigator, how it is helping make mortgage approvals more efficient and how he became an MJT Net partner.  Antonius Momac also talks about software testing at Triple Point Technologies. Phil Lewis from Siemens tells us how Macro Scheduler helps him administer a large DNS network.  Bob Hansen talks about how he’s made a living automating his clients’ processes; and Keith Passaur of eDocFile talks about document imaging automation.

“I couldn’t work without Macro Scheduler. It is the glue that allows me to automate all the other office applications together.  I couldn’t support my customer’s without it.  I’m just so happy I found it when I did.”  Bob Hansen.

It’s great to hear how different people are using and benefiting from Macro Scheduler, and it’s really useful for other people working in similar areas.  Hopefully this will become a regular series.  If you would like to take part, drop me a line and we’ll set it up.  If you would like to get in touch with anyone featured in a podcast you’ll find links to their company websites on the podcast page, most of them hang out in the forums, or you can just drop me a line and I’ll put you in touch.

You can also subscribe to the podcasts at iTunes.  Here.  Enjoy.

All the very best for 2009 folks!

December 18, 2008

The Telnet Functions – Get POP3 Message Count

Filed under: Automation, Scripting — Marcus Tettmar @ 1:41 pm

Recently in a forum post, “Getting New Email Message counts” terencepjf asked:

Does anyone know a way to get a count of New Email messages:

1) Without downloading all the messages
2) Count of messages in Inbox Sub-Folders

RetrievePOP3 works but the files need to be downloaded.”

My answer is to use the Telnet functions. You might not realise that POP3 – the protocol used to download email – is a Telnet protocol. You can Telnet into your POP3 server and see the messages waiting. POP3 usually runs on port 110, so you would telnet into the mail server on port 110. Try this from a command prompt (you type the italics):

telnet your.mail.server 110
+OK Hello there.
user your_username
+OK Password required
pass your_password
+OK Logged in
STAT
+OK 3 325657

So you simply issue “user” followed by your username, then “pass” followed by your password to log in. There are then various commands you can issue. STAT returns the number of messages waiting on the server and their size. Note that STAT returns a string in the format:

+OK MESSAGE_COUNT MESSAGE_SIZE

There are other commands you could use: LIST gets a list of the messages on the server, with their sizes. RETR n would retrieve one of them.

So we could use the STAT command to get the number of messages on the server. This is a useful exercise in the Macro Scheduler Telnet functions:

TelnetConnect – connect to a telnet server
TelnetSend – send a string to a telnet server
TelnetWaitFor – wait for a specific response and returns the text received
TelnetClose – close the session

So here’s the code to connect to a pop3 server, enter username and password and issue the STAT command, then disconnect:

TelnetConnect>mail.server.com,110,pop3
TelnetSend>pop3,user YOUR_USER_NAME%CRLF%
TelnetWaitFor>pop3,Password required,5,resp
TelnetSend>pop3,pass YOUR_PASSWORD%CRLF%
TelnetWaitFor>pop3,logged in,5,resp
TelnetSend>pop3,STAT%CRLF%
TelnetWaitFor>pop3,OK,5,resp
TelnetClose>pop3

Line 1 connects to the mail server on port 110 and returns a session variable which we will use to access this session with the other commands.

Line 2 sends “user YOUR_USER_NAME”. Note that we also send a CRLF, otherwise it would be as if we didn’t press return. Nothing happens until the telnet server receives a CRLF.

Line 3 waits for “Password required” to be returned. We then know the server is ready to receive the password.

Line 4 sends “pass YOUR_PASSWORD” followed by the obligatory CRLF.

Line 5 waits for “logged in” to be returned.

Line 6 then sends the STAT command and Line 7 waits for it to complete (waits for “OK”).

The TelnetWaitFor command returns the response in a variable, which we have called “resp” above. We can now parse this to determine the number of messages waiting. As noted above STAT returns the message count in the second column. So we just need to do:

Separate>resp,SPACE,parts
Let>count=parts_2
MessageModal>There are %count% messages waiting

In other words, we split the returned lines into an array delimited by the SPACE character. So we end up with three entries, where the second is the one we want.

So the full script to connect to a mail server and retrieve the message count is:

TelnetConnect>mail.server.com,110,pop3
TelnetSend>pop3,user YOUR_USERNAME%CRLF%
TelnetWaitFor>pop3,Password required,5,resp
TelnetSend>pop3,pass YOUR_PASSWORD%CRLF%
TelnetWaitFor>pop3,logged in,5,resp
TelnetSend>pop3,STAT%CRLF%
TelnetWaitFor>pop3,OK,5,resp
TelnetClose>pop3
Separate>resp,SPACE,parts
Let>count=parts_2
MessageModal>There are %count% messages waiting

Only 11 lines of code. It will work quickly and transparently without having to download anything to disc. More to the point, it’s a useful example on how to use the Telnet functions. Hope you find it helpful.

December 17, 2008

WebRecorder and Workflow Designer Updates

Filed under: Announcements — Marcus Tettmar @ 11:14 am

WebRecorder and IEAuto.DLL have been updated to 2.06 and 2.04 respectively with the following changes:

WebRecorder: Fixed URL address combo box to correctly autocomplete.
IEAuto.DLL: Added ExtractTagByName function to extract tag data by name or ID
IEAuto.DLL: Added ExtractTableByName function to extract table by name or ID

Workflow Designer was also updated for the latest Macro Scheduler script engine. Also fixed a bug with the trial version which could show an access violation on startup.

WebRecorder | Workflow Designer

December 15, 2008

Mass Import of Scripts and Groups to v11

Filed under: General — Marcus Tettmar @ 11:23 am

Because Macro Scheduler 11 saves scripts with Unicode encoding, and previous versions understand only ANSI encoding the decision was made to install Macro Scheduler 11 into its own folder, with its own data folder and registry hive. By keeping it entirely separate from previous versions it can run side by side with a previous version without any chance of scripts being prevented from being opened in the old version. If you open a script up in v11, save it, and then try to open it in v10 it will appear corrupt (though this is recoverable – more in a sec). So for those that will continue to use v10 for a while it is sensible to keep things separate.

However, if you are happy and ready just to point v11 at your existing setup you can do so quickly by exiting Macro Scheduler and modifying the following registry entry:

HKCU\Software\MJTNET\MSched11 – DataDir

Replace the value of DataDir with the path to your existing Macro Scheduler macro folder.

You’ll also want to copy comdef.ini from the Samples folder in the Macro Scheduler 11 Program Files folder into the macro folder above, overwriting the previous one – this contains the function definitions for the code builder – so you’ll want the v11 one.

Alternatively, if you still want to run v10 but want a complete copy, copy the entire contents of your v10 macro folder to the v11 macro folder (apart from comdef.ini). Then open up groups.ini and do a search/replace on the root macro folder so that all groups are now pointing at the new v11 folder.

In either case, make sure you exit Macro Scheduler fully first.

If you ever need to open a script in v10 (or earlier) that was edited/saved/created with v11 then do one of the following:

1. Open it in v11 and select File/Save As and select “ANSI Script Files” in the “Save as type” box, or,
2. Open it in Notepad, do File/Save As and select “ANSI” in the Encoding drop down.

December 9, 2008

Direct Access 2.0 – Text Shortcuts

Filed under: Announcements, General — Marcus Tettmar @ 9:07 pm

Direct Access - Text Replacement MacrosVersion 2.0 of Direct Access, a great text replacement, text shortcut tool, was released by our friends at Nagarsoft today.

Direct Access lets you assign actions and autoreplacements to text abbreviations. I use it to launch frequently used applications. E.g. I’ve assigned the text “ftp” to Filezila, my FTP client. So now, wherever I am in Windows, whatever application I’m in I can just type “ftp” and hit F12 and Filezilla is launched.

You can also use it for text replacements and text insertions. E.g. type “sig” when you need to insert your signature into an email or usenet or forum post. And of course you can also have Direct Access run Macro Scheduler macros. So you can make text shortcuts that run Macro Scheduler macros whatever application you are working in.

Version 2.0 has a redesigned interface to enhance ease of use; support for inserting rich text; network support for sharing action groups between PCs; confirming commands with delimiter keys such as SPACE and ENTER; and more.

Because Direct Access compliments Macro Scheduler so well we’ve arranged a special discount for Macro Scheduler customers. Macro Scheduler users can get 25% off the regular price of Direct Access. Registered users will find a discount coupon in the secure download area.

Congratulations to Nagarsoft on a great update to an already superb tool. Check it out.

December 8, 2008

Macro Scheduler 11.0.31 Update

Filed under: Announcements — Marcus Tettmar @ 10:42 am

Macro Scheduler 11.0.31 Update is now available with the following fixes:

Added: SetDialogObjectColor function
Change: Binary File Import now surrounds label and data in block comment to prevent an attempt to execute it
Fixed: SMTPSendMail not setting result code correctly
Fixed: Shift-Esc to Stop Window showing in GetWindowList
Fixed: Error in compiled macro if /NOSTOPKEY compiled in as last option
Fixed: Dialog Designer: After copying an object to clipboard, cannot paste it
Fixed: Dialog Designer: “Pinned to Designer” not staying pinned while moving design form
Fixed: Y array result variable default missing from FindImagePos code builder
Fixed: Index out of bounds error if start debug step from last blank line in script
Fixed: News Feed Notification was dependent on Show News Feed on Startup
Fixed: Main form shows correctly when clicking news feed notification
Fixed: Issue with Folder Browse button on Custom Dialog

Registered Downloads/Upgrades | Evaluation Downloads | New License Sales