I am having trouble using the MyFileseSize command in MS 6.2. I am trying to use MacroSched to find a file in a directory and then email the size of the file to me. I can get the test script below to display a message indicating the file size. The trouble is that when I paste this sample script in to the full script that opens Outlook Express, composes a new email message, and then sends the message the result of MyFileSize that is returned isn't a number, it is strange characters, "!)@(&^%^", minus the quotes. The only difference between the test script and the full script is that I change the last line of the test script to:
Send Character/Text>%MyFileSize%
The file size returned when using the test script is correct (10297656)
The file size returned when using the full script is incorrect (!)@(&^%^), minus leading and trailing parentheses. It appears to be the correct number of characters to represent the file size, but these don't look like numbers to me. What is going wrong?
*********Test Script below*************
Let>MyFileSize=0
wait>1
FileSize>C:\Path\nameoffile.mp3,MyFileSize
wait>1
MessageModal>%MyFileSize%
MyFileseSize results are strange
Moderators: JRL, Dorian (MJT support)
It is impossible to answer your question without seeing the script that has the problem. Have you stepped through it with the debugger? What does the log file show? Step through it slowly with the debugger with the watch list open so you can see what happens when. If you're still stuck post the script here so that we can be able to help.
MJT Net Support
[email protected]
[email protected]
Have you thought about to replace Outlook Express with MScheds SMTPSendMail>command ?
Code: Select all
Let>FS1=0
Label>SizeDetector
FileSize>C:\Path\nameoffile.mp3,FS1
Wait>2
FileSize>C:\Path\nameoffile.mp3,FS2
If>FS2>FS1,SizeDetector,SendMail
Label>SendMail
MessageModal>Final filesize: %FS2%
SMTPSendMail> ...
MyFileSize returns characters
Here is the test script and the full script. The Test script returns the file size, in bytes, of the file, the full script returns strange characters.
Thanks for any help.
************ Test script ****************
wait>1
Let>MyFileSize=0
wait>1
FileSize>C:\Audio\MP3\Ext720\Ext720a06232003.mp3,MyFileSize
wait>1
MessageModal>%MyFileSize%
wait>1
************ Full script ****************
wait>1
Run Program>"C:\Program Files\Outlook Express\MSIMN.EXE"
wait>5
Press CTRL
wait>.5
Send Character/Text>n
wait>.5
Release CTRL
wait>.5
Send Character/Text>emailaddress
wait>.5
Press Tab
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Shift
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Del
wait>1
*************** portion of script from Test script ********
Let>MyFileSize=0
wait>1
FileSize>C:\Audio\MP3\Ext720\Ext720a06232003.mp3,MyFileSize
wait>1
Send Character/Text>%MyFileSize%
Remark>****** send message *********
Press Alt
wait>.5
Send Character/Text>f
wait>.5
Release Alt
wait>.5
Send Character/Text>e
Thanks for any help.
************ Test script ****************
wait>1
Let>MyFileSize=0
wait>1
FileSize>C:\Audio\MP3\Ext720\Ext720a06232003.mp3,MyFileSize
wait>1
MessageModal>%MyFileSize%
wait>1
************ Full script ****************
wait>1
Run Program>"C:\Program Files\Outlook Express\MSIMN.EXE"
wait>5
Press CTRL
wait>.5
Send Character/Text>n
wait>.5
Release CTRL
wait>.5
Send Character/Text>emailaddress
wait>.5
Press Tab
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Shift
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Del
wait>1
*************** portion of script from Test script ********
Let>MyFileSize=0
wait>1
FileSize>C:\Audio\MP3\Ext720\Ext720a06232003.mp3,MyFileSize
wait>1
Send Character/Text>%MyFileSize%
Remark>****** send message *********
Press Alt
wait>.5
Send Character/Text>f
wait>.5
Release Alt
wait>.5
Send Character/Text>e
FileSize returns strange result
Thanks for catching that. I left it out of the requiest for help message, inserted it as shown below. The correction makes no change in the outcome.
wait>1
Run Program>"C:\Program Files\Outlook Express\MSIMN.EXE"
wait>5
Press CTRL
wait>.5
Send Character/Text>n
wait>.5
Release CTRL
wait>.5
Send Character/Text>emailaddress
wait>.5
Press Tab
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Shift
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Release Shift
wait>.5
Press Del
wait>1
Let>MyFileSize=0
wait>1
FileSize>C:\Audio\MP3\Ext720\Ext720a06232003.mp3,MyFileSize
wait>1
Send Character/Text>%MyFileSize%
Remark>****** send message *********
Press Alt
wait>.5
Send Character/Text>f
wait>.5
Release Alt
wait>.5
Send Character/Text>e
wait>1
Run Program>"C:\Program Files\Outlook Express\MSIMN.EXE"
wait>5
Press CTRL
wait>.5
Send Character/Text>n
wait>.5
Release CTRL
wait>.5
Send Character/Text>emailaddress
wait>.5
Press Tab
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Tab
wait>.5
Send Character/Text>Test
wait>.5
Press Shift
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Press Down
wait>.5
Release Shift
wait>.5
Press Del
wait>1
Let>MyFileSize=0
wait>1
FileSize>C:\Audio\MP3\Ext720\Ext720a06232003.mp3,MyFileSize
wait>1
Send Character/Text>%MyFileSize%
Remark>****** send message *********
Press Alt
wait>.5
Send Character/Text>f
wait>.5
Release Alt
wait>.5
Send Character/Text>e
Have a try to get rid of any Shift statement 
Your Shift-Down-Delete section looks like you wanna get rid of a default mail signature. If no other text should be kept, why not wipe it completely away and write afterwards whatever you want?

Your Shift-Down-Delete section looks like you wanna get rid of a default mail signature. If no other text should be kept, why not wipe it completely away and write afterwards whatever you want?
Code: Select all
//Select All
Press CTRL
Send>A
Release CTRL
//Replace it with the string
Send>%MyFileSize%
//SendMail
Press ALT
Send>S
Release ALT