Status Window, Macro Running button

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mondi
Newbie
Posts: 6
Joined: Thu May 18, 2006 9:56 pm

Status Window, Macro Running button

Post by mondi » Thu May 18, 2006 10:04 pm

Hey All,

Fairly new here, but loving Macro Scheduler.

I need a little help on two things.

First, I would like to display a window that updates with log messages. I found something similar to what I am talking about, monitoring a real time log, in this thread: http://www.mjtnet.com/forum/viewtopic.p ... t=real+log

But I am looking for something more for my users, like a status window that notes the progress of the script.

Second, I would like to have a button or window that indicates the macro is running... and either instructions on how to stop the macro i.e pess shift-escape to stop macro, or just a button to click.

I don't think I can do this with MS, I don't see anything that would let me open a window and write to it... other than say open notepad and write to it bouncing back and forth between the application I am controling and notepad for status updates.

Any ideas?

mondi

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu May 18, 2006 10:41 pm

Hi Mondi,

Go to Macro Scheduler help and look up "dialog". Also search this forum for "dialog". What you want to do will require you to become familiar with creating dialog boxes and populating the fields with information pulled from your log files and/or pushing information to your log files from user input through fields you set up in your dialog boxes. Macro Scheduler is a very useful tool in this regard. It is in fact the primary reason I own it. Everything you describe is possible. Find some sample dialog scripts and try them out.

Good luck,
Dick

mondi
Newbie
Posts: 6
Joined: Thu May 18, 2006 9:56 pm

Post by mondi » Thu May 18, 2006 10:46 pm

Dick,

Thank you very much! Exactly what I was looking for! This should eat up the rest of the afternoon nicley ;).

mondi

mondi
Newbie
Posts: 6
Joined: Thu May 18, 2006 9:56 pm

Post by mondi » Fri May 19, 2006 4:35 am

I have made some great progress with your suggestions Dick. I have my status window and I am updating it with messages as my script progresses.

I decided to use a Memo object becuase it seemed the most appropriate. The issue I am running into is, once I fill up the box additional messages are added of course, but the box does not scroll as new text is entered.

Is there a way to force this to scroll?

I suppose I could have the latest messages on top... Seems a little counterintuative, but it would work if there is no way to make the box scroll.

I suppose I could also clear the text after so many lines and write them to a log file...

Is a Memo object the best joice for this? Is there a way to make the memo object scroll with the new text? Or should I use one of my supposes above? ;).

Mondi

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 19, 2006 7:14 am

Send the memo object a CTRL-END sequence:

SetFocus>Your_Dialog
//ensure the memo is focused here
Press CTRL
Press End
Release CTRL

That's a low tech but very effective and easy solution. Another would be to use LibFunc with the Win32 API function SendMessage to send the memo a scroll message directly. Frankly, sending CTRL-END does the same in less code anyway.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mondi
Newbie
Posts: 6
Joined: Thu May 18, 2006 9:56 pm

Post by mondi » Tue May 23, 2006 8:18 pm

Not only is MacroScheduler great... the help from this forum is great! Not to mention very speedy. Thanks for a great product, and great support.

Mondi

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Wed May 24, 2006 3:35 pm

What about a progress bar as well? Here is something that I use versions of to give users a graphic and a progress window, just add loops to update the message and bar as required.

Message>Running
Let>k=0
Let>CPTN=Processing
Dialog>PROGBAR
Caption=%CPTN%
Left=550
Top=50
Width=451
Height=43
ProgressBar=PBAR,0,0,441,16,0
EndDialog>PROGBAR
Label>Start
If>k>99,End
Wait>1
GoSub>PROGRESS
GoTo>Start
Label>End
////////////////////SUBROUTINES//////////////
Srt>PROGRESS
Show>PROGBAR
Let>k=k+10
Let>PROGBAR.PBAR=k
ResetDialogAction>PROGBAR
End>PROGRESS

[/code]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts