0 Replies Latest reply on Jun 5, 2014 5:25 AM by MatLac

    Auto save script

    MatLac Level 1

      I'm thinking about creating an auto-save script.  I would create a static date-time object on opening as well as a constant called saveNumber with a value of 0.

      Here's a rough idea:

       

       

      in a calculate event:

      var now = new Date()

      var duration = openTime - now;  //how much time as it be opened?

      var period = math.floor(duration /5minutes)  //How much complete periods of 5 minutes has it been?

      if (period > saveNumber){

           saveMyFile(this, path)

           saveNumber = period

      }

       

      Would it work?