March 8, 2010

Screen Magnifier In Only 34 Lines of Code

Filed under: General, Scripting — Marcus Tettmar @ 9:46 am

Check out this screen magnifier, written by Dick Lockey in only 34 lines of Macro Scheduler code.   Paste it into a macro, hit run and then as you move the mouse around your screen you’ll see a 5x magnification of the cursor area.

Dialog>Dialog1
   Caption=5X Magnify
   Width=800
   Height=500
   Top=500
   Left=48
EndDialog>Dialog1
Show>Dialog1
  LibFunc>user32,GetDC,HDC1,Dialog1.handle
  LibFunc>user32,GetDC,HDC3,0

Label>Loop
  GetDialogAction>Dialog1,res1
  If>res1=2
    Exit>0
  EndIf
  GetCursorPos>CurX,CurY
  Sub>CurX,80
  Sub>CurY,50
  Wait>0.01
  LibFunc>Gdi32,StretchBlt,SBres,HDC1,0,0,800,500,HDC3,CURX,CURY,160,100,13369376
  GoSub>DrawLine,Dialog1.handle,1,0,390,250,410,250
  GoSub>DrawLine,Dialog1.handle,1,0,400,240,400,260
Goto>Loop

SRT>DrawLine
  LibFunc>user32,GetDC,HDC,%DrawLine_var_1%
  LibFunc>gdi32,CreatePen,Penres,0,%DrawLine_var_2%,%DrawLine_var_3%
  LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
  Libfunc>gdi32,MoveToEx,mtres,HDC,%DrawLine_var_4%,%DrawLine_var_5%,0
  LibFunc>gdi32,LineTo,ltres,hdc,%DrawLine_var_6%,%DrawLine_var_7%
  LibFunc>gdi32,DeleteObject,DOres,Penres
  LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawLine

Yes, as Dick Says, you get one of these with Windows. But it’s kind of cool to see you can do the same thing with Macro Scheduler, and the code might come in handy elsewhere.

Enjoy.

March 4, 2010

Choose Your Web Browser

Filed under: General, Web/Tech — Marcus Tettmar @ 10:39 am

One of my Windows XP systems installed an automatic update last night when I shut it down.  This morning I was presented with this:

Windows EU WebBrowser Choice

As I understand it this is as a result of an EU competition law decision.   Is this a good thing or a bad thing?

On the one hand it seems a waste of money and illogical.

I’m no fan of IE, but why shouldn’t Microsoft build a web browser and make it part of their operating system?  Should the EU force them to offer a choice of text editors, calculators, paint programs and calendar applications too? Where should it end?

Plus, yet another dialog like this is surely going to confuse the ordinary user.  Many have no idea what a “web browser” is and just call it “My Internet” or “Google”.  The dialog preceding the one above has to go to the trouble of explaining what a web browser is.  And isn’t the user just going to take the first option anyway?  In which case should the EU force Microsoft to make IE8 something other than the default option?

But then if I were trying to sell a web browser I guess I would welcome this decision. It might give me a little extra exposure.

What do you think?

March 1, 2010

Convert raw VBScript .vbs files to Macro Scheduler Scripts

Filed under: Scripting — Marcus Tettmar @ 2:34 pm

As you probably know Macro Scheduler scripts can include Microsoft VBScript. Not only can you CALL VBScript code you can also pass values into it and retrieve values out of it (I’ve seen many competitors claim you can use VBScript in their macros when what they really mean is you can only call external VBScripts and not get results and data back).

This means you can take VBScript code and embed it into your macros. However, you may need to make some small modifications to VBScript code samples you find out there in the wild, and I’m often being asked how to do this.

Usually the only changes necessary involve the fact that many sample scripts are designed to run as standalone .VBS files and make use of the WScript object. This object is instantiated automatically by the Windows Scripting Host and offers methods like “Echo” and “Sleep” which you’ll often see in sample scripts. But in the case of Macro Scheduler VBScript is being hosted by Macro Scheduler, not the Windows Scripting Host, so WScript is not available.

Therefore anything starting with WScript will need to be removed or replaced with something else.

The most common one is WScript.Echo. This simply displays a message. When the VBS file is run on the command line the message is output to the command line. Otherwise it appears in a pop up message box. Most of the time in sample scripts it is just there as an example, so you can see the code working. You’d probably end up not wanting the script popping lots of message boxes anyway. But if you do you could replace it with MsgBox.

So, remove references to WScript and you should find you’re good to go.

Update: Macro Scheduler 12 (currently in beta) ships with a built-in WScript object which implements the Echo and Sleep functions. This means that Wscript.Echo and WScript.Sleep functions will continue to work and will not need to be removed to make the .vbs work in Macro Scheduler.

February 18, 2010

February 17, 2010

And The Winner Is …

Filed under: Uncategorized — Marcus Tettmar @ 11:44 am

Thanks to everyone who entered our T-Shirt design competition. I’ve really enjoyed seeing all the entries and it has been very difficult to pick a winner. All entries are excellent in their own right and there are some great slogans, creative designs and novel concepts.

I have a number of favourite designs and, personally, I found it very hard to choose an outright winner. But the consensus amongst all the judges was for this one:

includekitchensink

We all like the way this conveys the right message in a simple, elegant way. Ok, some die-hard Macro Scheduler techies pointed out that the syntax isn’t Macro Scheduler syntax. But I don’t think that matters (the syntax used is recognisable and we could change the syntax and the message and concept would remain the same).

So, congratulations to Meryl for winning an Amazon Kindle!

Commiserations to everyone else and I’m really sorry there isn’t a truck full of Kindles to give away, or I’d be dolling them out, because I really liked a lot of these entries.

I’ve posted a few of the entries for sale on the MJT Net Zazzle store.  I wanted to post more, but Zazzle wouldn’t give me the “Post for Sale” option on them.  No idea why.  If yours is one of them, and you’d like it added to the store, then maybe you need to edit something.  Let me know if you figure it out.

February 16, 2010

Seeking Industry Partners

Filed under: General — Marcus Tettmar @ 10:24 am

Are you a contractor, consultant, freelancer or value added reseller who knows and uses Macro Scheduler and works in a specific industry, like Health Care, Education or Manufacturing? If you are I’d like to hear from you.

I’m looking at opportunities for Macro Scheduler in vertical markets and would like to find people with industry experience who can add value and help us promote and support Macro Scheduler in their sector. We need help identifying the key systems and applications used in these markets and creating macros and solutions for them using Macro Scheduler.

It doesn’t really matter what industry you work in. Whatever your vertical market, if you’re a Macro Scheduler user with industry knowledge and the flexibility to explore opportunities, please get in touch.

February 5, 2010

FTP Uploader – Upload Files From Explorer

Filed under: Announcements, General — Marcus Tettmar @ 5:03 pm

Phil Pendlebury has written a really handy little tool for quickly uploading files from Windows Explorer, and he’s built it using Macro Scheduler.

With his FTP Uploader tool installed you can right click on any file and select Send To->FTP Uploader to quickly upload it to any FTP site.

It will remember the FTP server settings for you and you can choose which FTP settings to use. If the uploaded file has a public web URL the tool will also create the URL for you and put it on the clipboard. Handy for sending people links to file, or uploading images and other files for use in forums.

FTP Uploader

You can download the tool and get the source code here.

I’m often uploading files to our FTP server to send to people, instead of relying on Email attachments. This tool will make short shrift of that. Thanks Phil!

February 1, 2010

Amazon Kindle T-Shirt Competition Now Closed

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

The T-Shirt competition is now closed. Many thanks for all your creative contributions. We will now get our heads together, look through the entries and decide on a winner. Will aim to announce a winner by 15th Feb.

January 29, 2010

Running Macro Scheduler Macros over the Web Via PHP

Filed under: Automation, General, Scripting, Web/Tech — Marcus Tettmar @ 9:31 am

Here’s a quick and simple proof of concept for running Macro Scheduler macros via the web and having their output displayed in the user’s browser:

Running Macro Scheduler Macros Over the Web Via PHP

The screenshot shows the PHP script, Macro Scheduler script and Internet Explorer being used to run the macro.

1) If you don’t already have a Windows based web server with PHP running, download and install WAMPServer. It’s easy.

2) Create a simple PHP script which takes an EXE name as a parameter and any parameters you want to pass to it. The following script will run EXEs that are in the c:\wamp\ folder, passing in any parameters provided and will dispay the EXEs output.

<?php
$exe = $_GET['exe'];

$dir = "c:\\wamp\\";

$parms = "";
foreach($_GET as $key=>$val) {
  $parms .= "/$key=$val ";
}

echo shell_exec("\"$dir$exe\" $parms");
?>

3) PHP’s safemode must be disabled for this script to work.

4) Create a Macro Scheduler macro and use SOWrite or SOWriteLn to output information. Compile it with the “Create Console App” option checked. Compile the EXE (or copy it) to the c:\wamp\ folder.

5) Now the macro can be executed via the web using http://servername/runmacro.php?exe=my.exe&parm1=value&etc=… which could be a link or entered into the browser directly.

6) Consider adding further security to the script to prevent anyone running any EXE on your server, or putting it in a password protected folder. I’ll leave that to you.

Macro Scheduler Enterprise comes with the msNet Remote Controller which includes a CGI module for running Macro Scheduler macros via web servers.