Monitoring a folder for size

Hello,

I am running OS/X . 2.6 with Script Editor 1.9. And I am trying to create a
watch folder script that will monitor a particular folder so that when it reaches a predefined limit of say, 675 megabytes, I’ll be informed of this fact and can then save the folder to CD.

 I should mention that I am still in the process of learning what to many of you may seem basic applescripting.  Here's what I have so far, and in testing with two folders, one containing (according to the Finder's info) 650 M.B. and the other containing 695 M.B., the dialog box responds correctly only HALF of the time.

tell application “Finder”
set theProps to properties of (choose folder)
get size of theProps
set x to size of theProps --renders size of folder in megabytes
if x > 6.75E+8 then --That’s somewhere between 675 and 697 M.B
display dialog “NOW’S THE TIME!”
else
display dialog “MAYBE LATER.”
end if
end tell

 Please tell me what I am doing wrong, or could do better.

Thanks in advance for any suggestions.

Sincerely,

Variable as the shade

Two things to take a look at: this thread and this post to Code Exchange

Jon

Many thanks, jonn8.

For your helpful advice. I am now one happy little newbie applescripter again.

Sincerely,

Variable as the shade