View Single Post
Old 20th November 2013, 12:17 PM   #5
Junior Member
Geoffm's Avatar
Join Date: Aug 2013
Location: London UK
Posts: 22
Default Re: Auto Save to Time

Save this script as auto_save.tcl in <ac3d_dir>/scripts.

namespace eval asave {
    # Autosave implementation
    variable nsave 0 ;# count number of saves for file name.
    proc auto_save {ms} {
        # if a model is loaded, save version N, repeat after ms millisec
        global nsave
        global unsaved_changes
        global acfilename ;# last saved file name
        if {$unsaved_changes} {
            incr nsave
            set orname $acfilename
            set fname [file root $acfilename]_${nsave}.ac
            puts "Save $nsave as $fname"
            set acfilename $fname
            set acfilename $orname
        after $ms "eval asave::auto_save $ms"
    asave::auto_save 60000 ;# 60000 = 1 minute.
    # puts "Autosave start"
to automatically save your current file as <orignal name> and so on.

Will only make a backup if a change is detected (the changes which cause 'changes made do you want to save' on Exit). Makes a save every minute if there is a change; replace 60000 with 10000 if you want to fill up your disk quickly.
Geoffm is offline   Reply With Quote