Hiding Msch window and some other needs!

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Dave

Hiding Msch window and some other needs!

Post by Dave » Wed Apr 16, 2003 12:59 am

Howdy everybody.

Is there a way to hide the 'Macro Scheduler' icon from appearing on the task bar? I use an exe file that was created from MS Pro 7.1, with the switch -HIDE -NOSYSTRAY, but it only hides the the pop-up 'Press Shift Escape to exit'. Better yet, can the exe file be ran as a service in WinNT and WinXP?

The second question is about the window message that the command
'Message Modal' (MDL) generates. Can we customize the window to show a custom label, such as 'Warning', rather than the default 'Macro Scheduler' title?

Thirdly, any error when running the scrip will pops up a modal message and the script stops. Is there a way to continue the script until we can address it (such as when a script is running at nite, there is no one around to clear the error message).

Thanks for helping. This utility program is the best investment I ever made. Thanks again.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Apr 16, 2003 8:41 am

Hi,

My answers all relate to version 7.2 ...

You need to use:

exename.exe /NOSYSTRAY /HIDE

To run an EXE as a service use SrvAny from the Windows resource kit. All depends what you want to do. You may just want to schedule the EXE with AT / Task Scheduler to run when the machine is locked, or if you intend for it to be running all the time you will need to take this into account when you write the script and use a program such as SrvAny.

Regarding a customised modal dialog, create your own custom dialog with the dialog editor and give it any title you wish.

Regarding stopping errors appear, most errors can be avoided by detecting the cause in the script itself. e.g. check for existance of files before attempting to do stuff with them and branch accordingly. A well written script shouldn't cause any errors to pop up at all. Which errors are you getting?
MJT Net Support
[email protected]

Guest

Post by Guest » Wed Apr 16, 2003 10:15 pm

Hi Support,

"exename.exe /NOSYSTRAY /HIDE' works great. Thanks.

". . Regarding a customised modal dialog, create your own custom dialog with the dialog editor and give it any title you wish.. ." There is some instruction in the help file that I am still digging at it.

. . "Regarding stopping errors appear, most errors can be avoided by detecting the cause in the script itself. e.g. check for existance of files before attempting to do stuff with them and branch accordingly. A well written script shouldn't cause any errors to pop up at all. Which errors are you getting? . . "
Example is:
Let>RP_WAIT=1
Label>COMPACTDBASE
Let>N=1
. . .
. . .
Label>19
Let>AAA=\\NetworkDBase\db19.MDB
IFE>%AAA%,COMPACTROUTINE
Let>N=N+1
Label>20
Let>AAA=\\NetworkDBase\db20.MDB
IFE>%AAA%,COMPACTROUTINE
Let>N=N+1
. . .
. . .
Label>COMPACTROUTINE
Run Program>"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "%AAA%" /compact
Let>N=N+1
If>N=44,COMPACTDBASE
Goto>%N%
. . .
The example works fine. But if a database is corrupt and needs repair, error message would appear and the script stops.
In this case, I would prefer that the script bypasses the database that is corrupt and move on to the next one.
Can this be done?

Thanks again for your great help.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Apr 17, 2003 12:26 am

A thought:

Can you redirect the program error messages to an ErrorFile? Then read that ErrorFile with ReadLn, analyze contents, and decide whether or not to proceed? Could you insert a sub routine to periodically look to see if that "ErrorFile exists.

If error messages can't be redirected to a file, can you have a window open for the running program and have a sub routine to look for a particular subwindow to open or for certain text to change within that window?

I realize this is not a solution, I'm just trying to provide you with some thoughts about an approach to deal with the error messages that may come up. Perhaps these thoughts will help trigger the right solution for you.

Good luck.....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Dave

Post by Dave » Thu Apr 17, 2003 1:43 am

Hi Bob,
I was thinking in the same line of thought, however, the script stops so next line of code would not execute. This would have to be dealed with, I would think, by the developer of the software.
I hope that they would give the matter some consideration soon.
Thank you.

P.S. I tried to use the 'dialog designer' to change the title of the 'message module' but have no clue how to make it works. Would some one helps with the tip how to change the default title 'Macro Scheduler' to something line 'Warning'.

Thanks again.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Apr 17, 2003 4:10 am

The Dialog Window Heading is no problem. (Needs 7.2.xxx) There are a number of properties with the Dialog Window.
Use the one called Caption that is filled with a variable as shown here:
==========================

.....
.....
.....
Label>Error1
Let>ErrorCaption=something line 'Warning'
Let>WarningHelp=This is the message for Error 1
...
...
...
Dialog>MyNewWindow
Caption=%ErrorCaption%
Top=144
Width=250
Left=312
Height=150
Label=%WarningHelp%,34,30
Button=OK,28,80,75,25,1
Button=Cancel,120,80,75,25,2
EndDialog>MyNewWindow
PlayWav>Alarm.wav
Show>MyNewWindow,result

Label>End

======================

Hope this helps, good luck
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Dave

Post by Dave » Sat Apr 19, 2003 3:25 am

Hi Bob,

Thanks for the example. Indeed it works beautifully.

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