July 14, 2010

Launching URLs in Default Browser (and a small bug!)

Filed under: Automation, Scripting — Marcus Tettmar @ 10:06 am

A quick and easy way to launch a URL in the default web browser is just to use the ExecuteFile command:

ExecuteFile>http://www.mjtnet.com/

However, I have recently discovered that ExecuteFile is currently limited to a command line length of MAX_PATH (260 chars) and that if more than 260 chars are passed it will cause Macro Scheduler to crash. This is a bug that we’ll get fixed in the next update (increase the limit if possible AND prevent a crash if more chars than can be handled are passed).

Another way to launch a URL in the default browser is to use the Run command. First you need to determine the path to the default browser which you can do by querying the registry:

Let>url=http://www.mjtnet.com/

//get path of default browser ...
RegistryReadKey>HKEY_CLASSES_ROOT,htmlfile\shell\open\command,,browserEXE

Run>%browserEXE% %url%

July 12, 2010

Macro Scheduler 12.0.5 Update Available

Filed under: Announcements, Macro Recorder — Marcus Tettmar @ 10:11 am

Macro Scheduler 12.0.5 is now available with the following fixes:

  • Fixed: PNG images added to custom dialogs not saving correctly and therefore not displaying when dialog opened or script run.
  • Fixed: LClick and RClick not independent of left hand/right hand mouse settings (LCLick should always do primary button function).
  • Fixed: GetDialogProperty not retrieving properties of parent dialog itself (when object name ommitted).
  • Fixed: “The procedure entry point WTSUnRegisterSessionNotification could not be located in the dynamic link library wtsapi32.dll.” under Windows 2000.
  • Fixed: Macro Recorder failing to properly record window titles containing a colon character.
  • Fixed: Error messages in compiled scripts showing garbage instead of file name.

Workflow Designer and the SDK have also been updated to the same MacroScript version.

Registered Downloads/Upgrades | Evaluation Downloads | New License Sales

July 5, 2010

Success Story: Automated Information Retrieval and Report Production

Filed under: Success Stories — Marcus Tettmar @ 2:12 pm

This was posted to the forum recently and I thought I would share:

I’m currently using [Macro Scheduler] to pull aviation electronic manufacturing information from a SAP database, compile into a MS Access database, then generate a report such that the data becomes useful information needed to identify and prioritize manufacturing tasks and processes across a diverse profile of complex systems being manufactured.

Had to spend hour+ (heavy on the +) every day spread out throughout an entire shift getting this information manually. Often, due to the length of time to acquire the info, the information would be derived too late in the shift to make good use of it. Lost opportunities and manufacturing delays galore.

The information can now be gleaned by anyone within minutes. The entire department is empowered to work smarter through making use of accurate real-time visual status information. Status is no longer hidden or obscure to visualize.

I was able to understand and adapt to the very easy to use Macro Scheduler structure with little frustration. I found that things I tried actually worked as anticipated and worked far more reliably than I dared hope for. When stuck, I found EXACTLY what information I needed in your forums. In fact, I ecstatically found differing superior methods in other areas of interest while searching for these solutions.

I haven’t had this much fun in decades. I want to thank the crew @ mjtnet and the users of Macro Scheduler for the efforts that brought enlightenment to me of a better way to do things.

Share YOUR story – what do you use Macro Scheduler for and how does it benefit you?

June 28, 2010

WebRecorder Update

Filed under: Announcements — Marcus Tettmar @ 3:35 pm

WebRecorder has been updated with a new version of the runtime component – IEAuto.DLL version 2.07.

This fixes a small bug preventing the ExtractTagByName function from extracting form field values. ExtractTag was working correctly but the same functionality to retrieve form field values was missing from ExtractTagByName.

Registered users can download the WebRecorder update from the registered downloads area.

Macro Scheduler 12.0.4 Update Available

Filed under: Announcements — Marcus Tettmar @ 3:13 pm

Macro Scheduler 12.0.4 is now available with the following fixes:

  • Fixed: _DUMP_VARS not working in all circumstances
  • Fixed: XLSetCell help file topic has missing result variable
  • Fixed: XLSetCell help file topic has missing result variable
  • Fixed: XLSave not working if variable in filename

Workflow Designer and the SDK have also been updated to the same MacroScript version.

Registered Downloads/Upgrades | Evaluation Downloads | New License Sales

June 23, 2010

Associating a File Extension with a Compiled Macro

Filed under: General, Scripting — Marcus Tettmar @ 10:14 am

I have a few scripts which perform actions on files. Rather than have the script ask me what file to use, it is easier to associate the file type with the script so that I can just double click on the file (or right click and choose “Open with”) in Windows Explorer.

For this to work the script must first accept a file on the command line. Here’s a really simple script which reads the content of a file passed into the script with the “thefile” command line parameter:

ReadFile>%thefile%,fdata
MessageModal>fdata

If you were to compile this script and then pass thefile on the command line it would read in the file content and display it in a message box:

c:\path\myexe.exe /thefile=c:\somefile.mjt

Now, if we create a file association for .mjt files we would only need to double click on the .mjt file to have it open in the exe.

The easiest way to create a file association for a file that does not already have one is to just double click on the file in Windows Explorer. Then when asked choose to select from a list of installed programs and on the next dialog click on the “Browse” button to locate your executable.

If the file extension is already associated with other applications then right click on the file and choose “Open With” and then “Choose program…”, then UNCHECK “Always use the selected program to open this kind of file” and click on “Browse” to locate your executable.

Initially this won’t quite work. We need to make a small change, as this creates a mapping in the registry which looks like this:

“c:\path\myexe.exe” “%1”

We want to change it to:

“c:\path\myexe.exe” /thefile=”%1″

So after creating the file association via Windows Explorer we need to make a small registry change:

1. Fire up RegEdit.exe (Start/Run and then type regedit.exe)
2. Open HKEY_CLASSES_ROOT
3. Search for your exe name to find the “c:\path\myexe.exe” “%1” entry
4. Make the change as above, changing the “%1″ to /thefile=”%1”

Now, when you double click the file (or right click/Open with) it will launch your exe, with the filename passed to it in the “thefile” parameter.

You could actually code the script in such a way that you don’t need to do the registry change. You could parse the COMMAND_LINE system variable to get the file from the command line, without requiring a custom parameter name. This is discussed in this forum post which talks about being able to drag and drop a file onto a script.

If you want to create the file association programmatically, take a look at what registry entries are created by Windows when you do it manually. Then you can use the registry functions to achieve the same. E.g. this script associates .why files with the “c:\where\why.exe” executable expecting the file in a parameter called “thefile”:

RegistryWriteKey>HKEY_CLASSES_ROOT,.why,,why_auto_file
RegistryWriteKey>HKEY_CLASSES_ROOT,why_auto_file\shell\open\command,,"c:\where\why.exe" /thefile="%1"

June 7, 2010

Macro Scheduler 12.0.2 Update Available

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

Macro Scheduler 12.0.2 is now available with the following fixes:

  • Fixed: Exit command not working inside dialog event sub when macro run outside of debug
  • Fixed: Error when trying to save script opened in new tab
  • Fixed: “Macro in command line does not exist” error when running, via command line, a macro which calls another macro
  • Added: Version check when performing news feed check

Workflow Designer and the SDK have also been updated to the same MacroScript version.

Registered Downloads/Upgrades | Evaluation Downloads | New License Sales

Tettmar Jr v3.0 – Maria Christine

Filed under: Announcements — Marcus Tettmar @ 9:34 am

maria Well it was an eventful weekend here.  At 0352 on Sunday morning – 6th June 2010 – my daughter, Maria was born.  A quick and uneventful labour thankfully, so we were home at 7.30 in the morning!  So all well, though mother (and father too) rather tired due to it happening over night.

Essential work on my other baby – Macro Scheduler v12 – continues with another bug fix update expected asap, but if I fall asleep or have to rush off please understand …. 🙂

June 3, 2010

Macro Scheduler 12.0.1 Update Available

Filed under: Announcements — Marcus Tettmar @ 4:34 pm

Macro Scheduler 12.0.1 is now available with the following fixes:

  • Fixed: Old style modal dialogs returning wrong result when run in debugger
  • Fixed: Global vbscript not visible to event handler subroutines
  • Fixed: Autologon username error even if autologon unchecked
  • Fixed: Editing a macro belonging to a group when “All Macros” is selected causes macro to vanish

Workflow Designer and the SDK have also been updated to the same MacroScript version.

Registered Downloads/Upgrades | Evaluation Downloads | New License Sales

May 25, 2010

Tweetlib: A DLL Plugin for Tweeting Status Updates via oAuth

Filed under: Announcements, Automation, Scripting, Web/Tech — Marcus Tettmar @ 4:23 pm

As noted yesterday I have been waiting on Twitter to provide xAuth access. They declined, saying it was not appropriate. I’m not really sure why.

No matter, I decided to make a small DLL to simplify Tweeting from Macro Scheduler. It uses the full oAuth interface.

Implementing oAuth in Macro Scheduler code would require lots of VBScript code and would be very complicated (although doable in theory). So instead I decided to create a DLL which you can use in Macro Scheduler to tweet in one line of code.

You can download it here.

And then to post a status update all you need to do is something like this:

Let>message=Hello from Macro Scheduler
LibFunc>%SCRIPT_DIR%\tweetlib.dll,UpdateStatus,r,message,buff,1024

Note that the first time you call UpdateStatus you will be asked to log into Twitter and click “Allow” to authorise Macro Scheduler to access your account. You will then be given a PIN to enter. You only need to do this once. If you ever need to revoke access and start over call the RemoveCredentials function. Your Twitter username and password are NOT stored anywhere. This uses the oAuth authorisation scheme which provides an access token. It is the access token which is stored and this only allows Macro Scheduler to access the API for your account.

The return buffer will contain the XML of the status update operation if successful or an error message if not.

See readme.txt and sample .scp in the zip file. Enjoy.