Force Compress On Save

Hi Guyz, Is there a way to force "compress on save" using maxscript.
I created a button and if I want to press then it will compress the opened file
and save it as compressed without going to the option manually.
Below is my script that I want to try..Thanks in advance..

-----------------------------------------------------------
Rollout test ""
(
Button test "c o m p r e s s"
on test pressed do
(
CompressOnSave "CheckedBox = true"
saveMaxFile "Compressed.max"
)
)
createDialog test
-----------------------------------------------------------

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
reygerali's picture

Any suggestion? Thanks

Any suggestion? Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.