MessageModal> To Log File???

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kriemer
Pro Scripter
Posts: 57
Joined: Fri Oct 30, 2009 2:59 pm

MessageModal> To Log File???

Post by kriemer » Thu Jan 14, 2010 4:25 pm

Is it possible to save the output of "MessageModal>" to a log file.csv (or something like that)?

Many thanks

k

sarver311
Pro Scripter
Posts: 84
Joined: Tue Jun 17, 2008 6:37 pm

Post by sarver311 » Thu Jan 14, 2010 6:14 pm

Hi Kriemer,

I don't know that there is a way to capture the output for messagemodal but what you could do is in addition to your messagemodal line just put a writeln command below that has the same text.

Here is an example

let>mymessage=This is my message!
messagemodal>mymessage
writeln>c:\log.txt,result,mymessage

kriemer
Pro Scripter
Posts: 57
Joined: Fri Oct 30, 2009 2:59 pm

Post by kriemer » Thu Jan 14, 2010 10:34 pm

I have found a solution to my question. It is not exactly what I asked but it is mostly what I want.

Code: Select all

 
//Set Variable
  Let>Missing=Missing:%CRLF%

//Error Window & Log File Message
  Let>LogFile=c:\Reuters Log.txt
  GetDate>vToday
  Timestamp>LogFile,%vToday%,%Missing%
Of course this opens the next question, Is there any way to limit log file size. I expect the simplest way would be to delete the file based on file size.

Any additional ideas to enhance log files?

Regards

k

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

Post by JRL » Thu Jan 14, 2010 11:08 pm

Is it possible to save the output of "MessageModal>" to a log file.csv (or something like that)?
I agree with sarver311 that if it is your script you should be able to write the same data you displayed to a file. However, there are times when you're dealing with messages from an old script or a compiled script or someone else's script. In those instances try the technique in this post from jpuziano.

http://www.mjtnet.com/forum/viewtopic.php?t=5848
Is there any way to limit log file size. I expect the simplest way would be to delete the file based on file size.
Or maintain a set number of lines in the log by deleting old lines. You'd have to:

- write to the log file
- then read into the script the entire log file
- then write out line by line a fixed number of lines to a temporary file
- then delete the old log file
- then rename the temporary file to the log file name

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 Jan 14, 2010 11:10 pm

You can also use the MS variable to enable/disable the Macro Scheduler log file. Change the value anywhere in your script.

_WRITE_LOG_FILE

Set to 0 to temporarily disable logging. Set to 1 to enable.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

kriemer
Pro Scripter
Posts: 57
Joined: Fri Oct 30, 2009 2:59 pm

Post by kriemer » Thu Jan 14, 2010 11:13 pm

JRL,

Way too much effort to deal with a simple log file. In my case I will delete the file on the 1st of every month (or something like that).

Bob,

I'll give that a try.

As always, much thanks for the help.

k

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