Monday, October 11, 2010

MEL: Time Kill


So, you are sitting in the studio, and nothing-as-such is assigned to you, or may be you just do not wish to move that stupid mouse for some time and take a break, but want to look like working darn hard:

Here's a small script for you...

  1. int $amount = 0;

  2. progressWindow
  3. -title "Initializing..."
  4. -progress $amount
  5. -status "Preview: 0%"
  6. -isInterruptable true;

  7. while (true) {

  8. // Check if the dialog has been cancelled
  9. if ( `progressWindow -query -isCancelled` ) break;

  10. // Check if end condition has been reached
  11. if ( `progressWindow -query -progress` >= 100 ) break;

  12. $amount += 1;

  13. progressWindow -edit
  14. -progress $amount
  15. -status ("Preview: "+$amount+"%");

  16. pause -seconds 3;
  17. }

  18. progressWindow -endProgress;

Put it in a shelf button. When executed, it'll create a DUMB progress windw, which does nothing but wait for time specified to complete it's function and go off. You can change "strings" in line number 4, 6, 21 according your needs. To play with time: change variable $amount increment and `pause` at line number 17 and 23 respectively.

P.S. Hope my employers don't go through this ;)

1 comment:

  1. Always use the progress dialog from a script, never directly from the Script Editor.

    ReplyDelete