I agree it is something new, and can be added to wish list.
But problem with Date/TimeStamps is having to insert them at every line of script, even if it is a sub routine. And subs do not allow for easy variable values.
The current logging also includes %VariableValues% automatically on each line without any coding needed. Current logging is automatic for every line., works great
Another option to be considered whenever logging is allowed, is which of the three currently available formats will be used?
Thanks again for listening.
Logfile disable?
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Bob,
Thanks for all your assistance. Until the wishlist comes to pass, try this on for size. It will run the program with a LogFile if you provide the proper parameters and a password. the downside to what I'm demonstating is that if a user can RUN an uncompiled script, they can also VIEW that uncompiled script. That said, this could also be compiled.
/////change password "1234" in next line
If>LOGFILEPASSWORD=1234,SkipLogFileAbort
IfFileExists>LOGFILE,LogFileAbort
Label>SkipLogFileAbort
SRT>LogFileAbort
MDL>Process aborted Log File..%LOGFILE%..specified%CRLF%to run this script with a Log File you must pass%CRLF%/LOGFILEPASSWORD=password to the script along with /LOGFILE=filename
DeleteFile>%LOGFILE%
goto>quit
END>LogFileAbort
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=203
Left=16
Button=OK,56,160,75,25,3
Button=Cancel,312,160,75,25,2
RadioGroup=msRadioGroup1,Special Selections,120,32,185,105,First Selection%CRLF%Second Selection%CRLF%Third Selection,-1
EndDialog>Dialog1
Show>Dialog1
Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=3,Process
if>r=2,quit
Goto>ActionLoop
SRT>Process
CloseDialog>Dialog1
MDL>You selected %Dialog1.msRadioGroup1%
END>Process
Label>quit
If I had thought of checking for the existance of the filename yesterday instead of trying to identify the LOGFILE variable status, this thead may not have existed. There is still something funky about the LOGFILE variable but I'm not overly concerned about it with the info support has provided.
Hopefully this method will be useful,
Dick
Thanks for all your assistance. Until the wishlist comes to pass, try this on for size. It will run the program with a LogFile if you provide the proper parameters and a password. the downside to what I'm demonstating is that if a user can RUN an uncompiled script, they can also VIEW that uncompiled script. That said, this could also be compiled.
/////change password "1234" in next line
If>LOGFILEPASSWORD=1234,SkipLogFileAbort
IfFileExists>LOGFILE,LogFileAbort
Label>SkipLogFileAbort
SRT>LogFileAbort
MDL>Process aborted Log File..%LOGFILE%..specified%CRLF%to run this script with a Log File you must pass%CRLF%/LOGFILEPASSWORD=password to the script along with /LOGFILE=filename
DeleteFile>%LOGFILE%
goto>quit
END>LogFileAbort
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=203
Left=16
Button=OK,56,160,75,25,3
Button=Cancel,312,160,75,25,2
RadioGroup=msRadioGroup1,Special Selections,120,32,185,105,First Selection%CRLF%Second Selection%CRLF%Third Selection,-1
EndDialog>Dialog1
Show>Dialog1
Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=3,Process
if>r=2,quit
Goto>ActionLoop
SRT>Process
CloseDialog>Dialog1
MDL>You selected %Dialog1.msRadioGroup1%
END>Process
Label>quit
If I had thought of checking for the existance of the filename yesterday instead of trying to identify the LOGFILE variable status, this thead may not have existed. There is still something funky about the LOGFILE variable but I'm not overly concerned about it with the info support has provided.
Hopefully this method will be useful,
Dick
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
How did I get pulled into this?.......
Great job Dick with the logfile name and password checking.
But it opens up more questions again.
As you point out, if one can run the uncompiled script, then they can also read the script. But script can be encrypted which can prevent that.
But logging on non-compiled scripts can still be enabled from the Macro Properties, and I don't think the LOGFILE variable works with the log file defined in the Properties. I don't have a chance to check that out yet, but if I am correct then the nice work you have done may not work in that mode. So we still need a method to stop Control Panel logging.
On your script, I did call for a log file, and ran from the control panel, but was never prompted for a password, and script ran fine with selections. The line IfFileExists>LOGFILE,LogFileAbort fails because there is no value for LOGFILE. Could modify the checking for OK value of LOGFILEPASSWORD vs. just the value 1234. 1234 could enable logging with command logfile, and could Quit if no logfile AND no LOGFILEPASSWORD (null).
I hope this has made some sense. I have no time right now, but I am sure you can modify the script to do that.
Great job Dick with the logfile name and password checking.
But it opens up more questions again.
As you point out, if one can run the uncompiled script, then they can also read the script. But script can be encrypted which can prevent that.
But logging on non-compiled scripts can still be enabled from the Macro Properties, and I don't think the LOGFILE variable works with the log file defined in the Properties. I don't have a chance to check that out yet, but if I am correct then the nice work you have done may not work in that mode. So we still need a method to stop Control Panel logging.
On your script, I did call for a log file, and ran from the control panel, but was never prompted for a password, and script ran fine with selections. The line IfFileExists>LOGFILE,LogFileAbort fails because there is no value for LOGFILE. Could modify the checking for OK value of LOGFILEPASSWORD vs. just the value 1234. 1234 could enable logging with command logfile, and could Quit if no logfile AND no LOGFILEPASSWORD (null).
I hope this has made some sense. I have no time right now, but I am sure you can modify the script to do that.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Hmmm, didn't you volunteer?How did I get pulled into this?.......
You were correct that if the log file is enabled from the Macro Properties, no logfile information is passed to the script. Since the Maco Properties are stored in the "macros.dat" file, I used DOS find to acquire the name of the logfile, if it exists.
Also added an input for the password if the variable LOGFILEPASSWORD is not also passed to the script at execution.
So: usage is thus:
Setup a log file in properties and you'll be prompted for your password
Use /LOGFILE=[filename] at the comand line and you'll be prompted for your password.
Use /LOGFILE=[filename] /LOGFILEPASSWORD=[password] and you're in.
Be sure to enter the bracketed info into the first and second lines of this script
Let>password=[your password]
Let>scriptname=[script name without the .scp extension]
If>LOGFILEPASSWORD=%password%,SkipLogFileAbort
IfFileExists>LOGFILE,LogFileAbortEnterPassword
LET>RP_WAIT=1
Let>RP_WINDOWMODE=2
Run>cmd /c find /i "%scriptname%" "%SCRIPT_DIR%\macros.dat" > c:\~logfiletemp~
ReadLn>c:\~logfiletemp~,3,line
DeleteFile>c:\~logfiletemp~
Separate>line,",LogNameVar
If>LogNameVar_2=,SkipLogFileAbort
Let>LOGFILE=%LogNameVar_2%
GoSub>LogFileAbortEnterPassword
Label>SkipLogFileAbort
SRT>LogFileAbortEnterPassword
Let>INPUT_PASSWORD=1
Let>pk=0
Label>CheckPassWord
Let>pk=pk+1
Input>logpass,Enter your password to permit logging to %LOGFILE%...
If>logpass=1234,SkipLogFileAbort
If>logpass=,quit
MDL>Incorrect password attempt %pk% of 3
If>pk=3,LogFileAbort
Goto>CheckPassWord
END>LogFileAbortEnterPassword
SRT>LogFileAbort
Let>MSG_CENTERED=1
Let>MSG_WIDTH=320
MDL>Process aborted Log File..%LOGFILE%..specified...%CRLF%To run this script with a Log File you can pass:%CRLF%/LOGFILEPASSWORD=password%CRLF%to the script along with:%CRLF%/LOGFILE=filename%CRLF%This will avoid the program prompt.%CRLF%Or, type the password at the prompt.
DeleteFile>%LOGFILE%
goto>quit
END>LogFileAbort
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=203
Left=16
Button=OK,56,160,75,25,3
Button=Cancel,312,160,75,25,2
RadioGroup=msRadioGroup1,Special Selections,120,32,185,105,First Selection%CRLF%Second Selection%CRLF%Third Selection,-1
EndDialog>Dialog1
Show>Dialog1
Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=3,Process
if>r=2,quit
Goto>ActionLoop
SRT>Process
CloseDialog>Dialog1
MDL>You selected %Dialog1.msRadioGroup1%
END>Process
Label>quit
Let me know if you have any problems and/or suggestions.
It will definitely be easier when the next version comes out with this functionallity built in.

Dick
Last edited by JRL on Thu Sep 22, 2005 9:06 pm, edited 1 time in total.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Another great piece of work by JRL.......applause everyone!\
========================
Two observations on the latest script you have provided:
1. Need to change "1234" to %password% ?
2. Another issue in script above is that you are reading line3 of the dat file, but have no control on which line that will be on. So this would require hardcoding the specific line for each macro vs. generic coding, and then maintenance to make sure the right line has been selected for this specific macro script.
That is just one more typical obstacle that we uncover. We are taking 3 steps fwd and 1 step back, so we are making progress.
========================
I have responded to PM. There are still some outstanding issues, but I agree that perhaps right now, this is best handled between us using off-line messaging until we have a total solution.


========================
Two observations on the latest script you have provided:
1. Need to change "1234" to %password% ?
2. Another issue in script above is that you are reading line3 of the dat file, but have no control on which line that will be on. So this would require hardcoding the specific line for each macro vs. generic coding, and then maintenance to make sure the right line has been selected for this specific macro script.
That is just one more typical obstacle that we uncover. We are taking 3 steps fwd and 1 step back, so we are making progress.
========================
I have responded to PM. There are still some outstanding issues, but I agree that perhaps right now, this is best handled between us using off-line messaging until we have a total solution.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
We've added an 'Allow Logging' checkbox to the compiler options which when unchecked will add /LOGFILE=\dev\nul to the parameter box.
This is build 005 which hasn't been publicly released yet but can be downloaded from usual location.
This is build 005 which hasn't been publicly released yet but can be downloaded from usual location.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Oops,
I just realized that you are not reading line 3 of the dat file. You are looking at the redirected output of Find, the line that has the name of the script file on it......Ignore my earlier comment. This does not mean hardcoding, the generic version should work really well.
Again, congrats for your results.

Again, congrats for your results.

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