Autosave a patcher

Jan 18, 2007 at 1:35pm

Autosave a patcher

Is there a way, perhaps with thispatcher to automatically save a patcher
when it changes (i.e. Gets “dirty”)? I don’t mean the mode where it saves a
patcher and appends a number to the name. It must save with the same name.
I know I can do it with a write message to thispatcher but I want it to be
automatic. For example, I drag an object to a new position and it saves.

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#29780
Jan 18, 2007 at 2:19pm

Quote: Gary Lee Nelson wrote on Thu, 18 January 2007 14:35
—————————————————-
> Is there a way, perhaps with thispatcher to automatically save
> a patcher when it changes (i.e. Gets “dirty”)…

Hi Gary,

I’m using:

[active] – > poll -> [mousestate] -> write -> [thispatcher]

#P button 4 118 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 22 68 30 196617 poll;
#P newex 22 92 56 196617 mousestate;
#P newex 22 44 50 196617 active;
#P message 22 118 39 196617 write;
#N thispatcher;
#Q end;
#P newobj 22 140 58 196617 thispatcher;
#P connect 1 0 5 0;
#P connect 1 0 0 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P window clipboard copycount 6;

#93651
Jan 18, 2007 at 4:36pm

That is very clever but I felt a bit like Mickey Mouse in the Sorcerer’s
Apprentice. If you use new from clipboard you must save immediately or it
will put up a new save dialog for every mouse click. While it is polling,
it doesn’t allow typing into message boxes.

I am using this:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 31 873 42 196617 t write;
#P newex 31 851 32 196617 sel 3;
#P newex 30 829 40 196617 key;
#N thispatcher;
#Q end;
#P newobj 31 893 61 196617 thispatcher;
#P connect 3 0 0 0;
#P connect 2 0 3 0;
#P connect 1 0 2 0;
#P window clipboard copycount 4;

Pressing the enter key when I want to save. Not automatic but I can type as
usual and drag things around.

On 1/18/07 9:19 AM, “Philippe Gruchet”

wrote:

>
> Quote: Gary Lee Nelson wrote on Thu, 18 January 2007 14:35
> —————————————————-
>> Is there a way, perhaps with thispatcher to automatically save
>> a patcher when it changes (i.e. Gets “dirty”)…
>
> Hi Gary,
>
> I’m using:
>
> [active] – > poll -> [mousestate] -> write -> [thispatcher]
>
> #P button 4 118 15 0;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P message 22 68 30 196617 poll;
> #P newex 22 92 56 196617 mousestate;
> #P newex 22 44 50 196617 active;
> #P message 22 118 39 196617 write;
> #N thispatcher;
> #Q end;
> #P newobj 22 140 58 196617 thispatcher;
> #P connect 1 0 5 0;
> #P connect 1 0 0 0;
> #P connect 2 0 4 0;
> #P connect 4 0 3 0;
> #P connect 3 0 1 0;
> #P window clipboard copycount 6;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#93652
Jan 18, 2007 at 9:46pm

Quote: Gary Lee Nelson wrote on Thu, 18 January 2007 17:36
—————————————————-
> That is very clever but I felt a bit like Mickey Mouse in the
> Sorcerer’s Apprentice.

That’s my daily life, always discovering and learning :-)

> If you use new from clipboard you must save immediately or it
> will put up a new save dialog for every mouse click.

Of course, you have to save it first. Just once!
(double-cancel to defer, not too frequently… an old joke of ‘System $i’ is still around…)

> it doesn’t allow typing into message boxes.

You were asking for an auto-save on drag&drop, you got it.
;-)

Let’s try this one?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 71 30 50 196617 keyup;
#P window linecount 2;
#P message 120 138 124 196617 For writing , type first anything on your keyboard;
#B color 5;
#P window linecount 1;
#P message 102 171 161 196617 you can now drag’n drop & writing;
#B color 5;
#P button 111 108 15 0;
#P newex 71 53 50 196617 b 2;
#P newex 111 78 50 196617 del 4000;
#P button 71 108 15 0;
#P message 71 78 31 196617 nopoll;
#P button 60 170 15 0;
#P message 25 110 26 196617 poll;
#P newex 25 144 56 196617 mousestate;
#P newex 25 78 37 196617 active;
#P message 25 170 33 196617 write;
#N thispatcher;
#Q end;
#P newobj 25 192 58 196617 thispatcher;
#P connect 8 0 4 0;
#P connect 2 0 4 0;
#P connect 6 0 3 0;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P connect 1 0 0 0;
#P connect 1 0 5 0;
#P connect 13 0 9 0;
#P connect 9 0 6 0;
#P connect 6 0 7 0;
#P connect 9 1 8 0;
#P connect 8 0 10 0;
#P window clipboard copycount 14;

#93653
Jan 19, 2007 at 8:51am

Gary Lee Nelson wrote on Thu, 18 January 2007 17:36
> That is very clever but I felt a bit like Mickey Mouse in the
> Sorcerer’s Apprentice.

Goethe is probably rolling in his grave, but never mind.

Anyway, you would probably be better off to paste the snippet into an
existing file rather than a new patcher.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#93654
Mar 7, 2012 at 5:03pm

If you send the message [keydown 55, key 1] to aka.keyboard ( http://www.iamas.ac.jp/~aka/max/#aka_keyboard ) it simulates a cmd+s stroke on your keyboard and saves your patcher
so one could have a metro sending bang every 10 minutes

#93655
Mar 7, 2012 at 5:12pm

oh I forgot to mention you need to send a [keyup 55] after this message, otherwise it acts as if you’re still holding down the command key

#93656

You must be logged in to reply to this topic.