savebang


    Mar 14 2006 | 1:52 am
    Is there any way to know when a patcher is being saved?
    I'm working on maintaining and updating a large composition system that is running in Max 4.1 under OS 9, and it has its own coll-based storage system. For a couple of reasons, I need to manage the saving of coll data myself, so I would really like to know when a patcher is being saved so that I can save my private data at the same time.
    Thanks, Chris
    -- Chris Muir | "There are many futures and only one status quo. cbm@well.com | This is why conservatives mostly agree, http://www.xfade.com | and radicals always argue." - Brian Eno

    • Mar 14 2006 | 2:24 am
      Why don't you create some kind of autosave routine so that you know exactly when a patch is being saved?
      Check out thispatcher.help.
      -A
    • Mar 14 2006 | 2:26 am
      Chris Muir wrote: > > Is there any way to know when a patcher is being saved?
      I'd love to learn a better way, but maybe you could poll for the change from dirty to clean..?
      I'm working on a similar project here but I haven't tackled this part yet; ie, the above is a suggestion from ignorance.
    • Mar 14 2006 | 6:22 pm
      At 5:26 PM -0900 3/13/06, dlurk wrote: >I'd love to learn a better way, but maybe you could poll for the change from dirty to clean..?
      I don't know of a way to poll for the state of dirty/clean. You can set these with thispatcher, but I don't think that you can retrieve this state.
      Thanks for the suggestion, Chris
      -- Chris Muir | "There are many futures and only one status quo. cbm@well.com | This is why conservatives mostly agree, http://www.xfade.com | and radicals always argue." - Brian Eno
    • Mar 14 2006 | 6:22 pm
      At 6:24 PM -0800 3/13/06, Andrew Pask wrote: >Why don't you create some kind of autosave routine so that you know exactly when a patch is being saved....
      I already have something like that, but it doesn't suffice in some scenarios:
      The user quits Max, and Max asks "Save changes...?". I have no way of knowing how the user answers this question, so I don't know whether to commit changes.
      The user manually saves the parent patch (and thinks that all state is saved), then quits the program. I can (and do) do something with closebang, but I have no way of knowing whether the user really wants the data saved or not. Currently I make a backup of the data on close, but that's only a half measure.
      Thanks for the suggestion, -C
      -- Chris Muir | "There are many futures and only one status quo. cbm@well.com | This is why conservatives mostly agree, http://www.xfade.com | and radicals always argue." - Brian Eno
    • Mar 14 2006 | 6:48 pm
      Maybe you can use javascript to check the patcher file date. If the date matches the current (or close to it) time, then it has been saved.
      wes
    • Mar 14 2006 | 6:57 pm
      Yeah - I see what you mean. Maybe you could keep the patcher clean the whole time and completely replace the standard save mechanism with one of your own?
      Unfortunately js won't work in OS 9 :(
      -A
    • Mar 15 2006 | 4:03 am
      Yeah, that would probably work, but I'm stuck on an old version of Max on OS 9.
      Thanks for the suggestion, Chris
      -- Chris Muir | "There are many futures and only one status quo. cbm@well.com | This is why conservatives mostly agree, http://www.xfade.com | and radicals always argue." - Brian Eno
    • Mar 15 2006 | 4:04 am
      At 10:57 AM -0800 3/14/06, Andrew Pask wrote: >Unfortunately js won't work in OS 9 :(
      Yeah, and if I could run under OS X, I would probably just use the pattr* family of objects, anyway.
      Thanks for the suggestion, Chris
      -- Chris Muir | "There are many futures and only one status quo. cbm@well.com | This is why conservatives mostly agree, http://www.xfade.com | and radicals always argue." - Brian Eno