Is it possible to create a log where it states everything it is doing (Like a message or something but stays on top so it is constantly visable?). Also, can the style be changed so its wide etc? And is it possible to change the title of a message (Mouse Scheduler thingy)?
Thanks!
Is it possible to create a log?
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 33
- Joined: Sat Feb 27, 2010 8:11 pm
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Of course. You can log to a file using WriteLn or TimeStamp and/or enable logging for the macro and even write to the same file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Junior Coder
- Posts: 33
- Joined: Sat Feb 27, 2010 8:11 pm
Log
But can it be like a dialog and stay open on the screen and display stuff that it is doing?
Yes.
The simplest way is to use the Message command (Not MessageModal). It will display the most recently posted message, overwriting the previous. I believe the Dialog command lets you do this plus more.
You can also search the forums for a 3rd party (free I think) tool called "tail" that always displays the tail end of your logfile.
Gale
The simplest way is to use the Message command (Not MessageModal). It will display the most recently posted message, overwriting the previous. I believe the Dialog command lets you do this plus more.
You can also search the forums for a 3rd party (free I think) tool called "tail" that always displays the tail end of your logfile.
Gale
Here is an example of a Dialog that displays an error log. When you Click the generate button it puts a timestamp and message in a log file and stores the updated file in the dialog box to the right.
Code: Select all
let>errorlogs=
//This checks to see if this script has been run before, if it has it puts the old logs in the dialog box.
IfFileExists>c:\datelog.txt
ReadFile>c:\datelog.txt,ErrorLogs
endif
Dialog>dialog1
Caption=
Width=790
Height=398
Top=187
Left=20
Memo=msMemo1,225,50,472,159,%ErrorLogs%
Label=Log File Reports,224,24,true
Button=Generate,48,62,75,25,5
Label=Click to Create Time Stamp,48,40,true
Button=Exit,50,136,75,25,2
EndDialog>dialog1
show>dialog1
label>actionloop
GetDialogAction>dialog1,r
wait>.10
//If it see the button was clicked it generates a timestamp log
if>r=5
//puts the timestamp and error to a file
DateStamp>c:\datelog.txt,Error was Generated
//reads the file, stores it in the variable
ReadFile>c:\datelog.txt,ErrorLogs
//assigns value to the dialog memo box
let>dialog1.Msmemo1=ErrorLogs
resetdialogaction>dialog1
endif
//If exit was clicked then Script closes and exits.
if>r=2
exit
endif
goto>actionloop