MyFileseSize results are strange

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
tscottme

MyFileseSize results are strange

Post by tscottme » Sun Jul 20, 2003 8:07 am

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%

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

Post by support » Sun Jul 20, 2003 10:34 am

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]

Lumumba

Post by Lumumba » Sun Jul 20, 2003 12:11 pm

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> ...

tscottme

MyFileSize returns characters

Post by tscottme » Sun Jul 20, 2003 10:04 pm

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

Lumumba

Post by Lumumba » Mon Jul 21, 2003 6:24 am

Where's the Release Shift in the full script ?

tscottme

FileSize returns strange result

Post by tscottme » Mon Jul 21, 2003 9:51 am

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

Lumumba

Post by Lumumba » Mon Jul 21, 2003 12:41 pm

Have a try to get rid of any Shift statement :idea:

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

tscottme

filesize results

Post by tscottme » Mon Jul 21, 2003 9:54 pm

Thank you Lumumba, your suggestion worked.

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