## move_on_size.tg
# Is there any Wincron syntax that would allow me to make decisions after evaluating a file size?
#
# For example:
# 1)scan file for folder
# 2)if file > 1MB then move to folder 1
# if file < 1MB then move to folder 2

{
-name move_on_size
# fire every second
-start -inc 0 0 0 1

# if there are no more files, break
-action -onerror no_more_files

# get the next file, if there are no more files
# we will stop here
-action -getfile -newest c:\file_store\*.* THE_FILE

# okay, check to see if the files SIZE is greater than 1 meg
# if so, call bigger_1meg otherwise, call smaller_1meg
-action -onerror smaller_1meg
-action -test "%THE_FILE.SIZE% > 1024 * 1000"
-action -call bigger_1meg

}

## no_more_files
# no more files. Just tell the user and break from this run
{
-name no_more_files
-action -print there are no more files. Will try back later
-action -return break
}

## smaller_1meg
# we have a file smaller than 1meg, put it in the 'small' directory
{
-name smaller_1meg
-action -print smaller_1meg
-action -move "%THE_FILE%" "c:\file_store\small\%THE_FILE.FNAME%%THE_FILE.EXT%"
}

## bigger_1meg
# we have a file bigger than 1meg, put it in the 'big' directory
{
-name bigger_1meg
-action -print bigger_1meg
-action -move "%THE_FILE%" "c:\file_store\big\%THE_FILE.FNAME%%THE_FILE.EXT%"
}
_________________________
Regards,
Luke Tomasello