clear the max window from within a patcher ?

kp*'s icon

Is there anyway to clear the max window from within a patcher?

Sometimes you want to refresh a window for debugging/ and it is pain if you patch is big or your screen is small to find the max window behind the patcher and hit the x on the bottom then go back to your patch... seems like a small deal but if you are debugging lots of small errors or chasing an off by one or some such and having to do this tens, if not hundreds of times a day, it gets bothersome.

I just want to see the junk from the present execution of my patch and when i reset my patch i want the max window to clear too. I also get irritated by third party externs that are super chatty and muck up your max windah before execution. You can embed the whole dsp panel in your match... practically everything in max is a patch... is there no way to bang the max windah clear from within your patch? That would be boss.

-kp

loadmess's icon

Hi!
Yeah, I agree with you. Sometimes that makes me angry too.
I already tried to edit the "maxinterface.json" file, there's some lines in there about max window, but I had no sucess.
The solution I found so far is a series of shortcuts, which are not very handy because it's too many steps.
You are in your patch:
- use cmd+M to call max window.
- press cmd+A to select all
- press backspace to delete the selection
- then use the OSX shorcut "move focus to next window in active app", which in my mac is cmd+
That a bunch of steps, doesn't solve the problem at all.
Maybe with some kind of script to trigger all that shortcuts would be more usefull.

best regards,
dc

Luke Hall's icon

If you're on a mac you can use applescript and the [shell] or [aka.shell] external which you can find on maxobjects.com. I've attached one below which should do the job trick. You can trigger it by sending the message "osascript users///clearmaxwindow.scpt". You could also trigger the script using keyboard commands. I hope it helps.

lh

Rob Ramirez's icon

great script!

seejayjames's icon

thereishopeforus@hotmail.com wrote on Fri, 11 September 2009 09:19If you're on a mac you can use applescript and the [shell] or [aka.shell] external which you can find on maxobjects.com. I've attached one below which should do the job trick.

lh

It would be nice to have a script which does this, which I seem to do a lot:

--Hide Foreground
--Hide Background
--Select All (cords)
--Hide on Lock
--Show Background
--Show Foreground

I think the foreground/background stuff can be done with messages to Max, but I don't know about the selection and Hide on Lock. It would be interesting to see how far one could go within Max itself (without {shell]), I imagine most commands are possible, but may be unexposed for safety reasons... you know how sloppy we users can get...

Luke Hall's icon

If you want to show/hide all patchcords I find it easier to select all and then command+shift+drag to de-select everything but the patch cords and then toggle show or hide. However you can do this all with keyboard shiftcuts in max. You need to edit the maxinterface.json text file. Go to about line 375 and you will find the "Show Foreground" and "Show Background" blocks, edit them to look something like this:

        {
            "message" : "showfg",
            "label" : "Show Foreground",
            "target" : "owner",
            "invmsg" : "hidefg",
            "invlabel" : "Hide Foreground",
            "shortcut" : "option+A"
        },
        {
            "message" : "showbg",
            "label" : "Show Background",
            "target" : "owner",
            "invmsg" : "hidebg",
            "invlabel" : "Hide Background",
            "shortcut" : "option+S"
        },

Notice that I've added a ,comma, to the end of the last line before my new "shortcut" definition. This will make the shortcut toggle for show/hide foreground command+alt+A and show/hide background will be command+alt+S (on a mac at least!). Now you should be able to run through the keyboard shortcuts in order:

command + E
command + alt + A
command + alt + S
command + A
command + K (or command + L)
command + alt + A
command + alt + S
command + E

and voila you can show/hide all patchcords, not quite as simple as one shortcut to do everything but it does work. You can also create a shortcut for copy compressed which I find really useful. You will have to restart max for the new shortcuts to take effect but the cool thing is that the key codes show up in the menus so you won't have to worry about forgetting them.

lh

Roman Thilenius's icon

nice idea with the shellscript.

back in the days i have been using

"______________________"
 |
[print ]

to get some structure into messy maxmsp consoles, works too.

-110

Luke Hall's icon

Yeh that's a nice trick too, especially when you're checking something a bit hectic and you have [print]s all over the place. I've written a little javascript which is like [print] which you can instantiate with multiple arguments and gives you an input for each, nothing major but it saves a few seconds here and there.

lh

// lh.nprint
inlets = jsarguments.length - 1;

function anything() {
    everything = arrayfromargs(messagename, arguments);
    parsed = everything.map(format);
    names = jsarguments.map(format);
    function format(x) {
        if (typeof(x) == "number") {
            if (x % 1 == 0) {
                return x;
            } else {
                return x.toFixed(6).toString().replace(/0+$/,"");
            }
        } else {
            return x;
        }
    }
    post(names[inlet + 1] + ": " + parsed.join(" ") + "n");
}
// EOF

loadmess's icon

Hi All!

There is a external to clean max window, check here:
http://www.bloghotel.org/tworowski/85531/

donkey's icon

great external !
thanks a lot for this :-)

it would be realy cool to implement a save function.
best,
d.

dhjdhjdhj's icon

Just tried this external with Max 6, and it doesn't seem to work.

I'm surprised there isn't a clearmaxwindow message that can be sent to the 'max' object

Peter Ostry's icon

Why doesn't cycling74 just make a keyboard shortcut to clear the Max window?
This user request is as old as this window ...

dhjdhjdhj's icon

A keyboard shortcut doesn't really help. I'm sending a lot of log info to the max window and when certain patchers change, the old log info is of no use and I'd like it to just go away automatically when the next patcher is loaded (as loading is also done programatically)

Roald Baudoux's icon

Dear uncle Cycling, the year is 2012, we have robots and nanotech, Pro Tools is running on soundcards from third parties and we even have Max VI.

But... ...it's still not possible to clean the Max window from within a patcher. Is is prohibited by religion, Microsoft or even Apple ?

Vincent Goudard's icon

+1
Yes, it would be really nice, when distributing apps made with max, to have the ability to ease the task of sending [parts of] the Max window to the developpers from unexperienced end-users.
Being able to do the following with messages-to-max (or to some object, whatever) would be reaaaaally nice :
- clear the max window
- dumping [parts of it] in a coll

any reply from unkle'74 ?

Marcos's icon

bump!

Nat's icon

bumpy bump

keepsound's icon

bump, need it too!mwc don't works in Max 6.1.2, reports another "ok" message in the Max Window.
Working with shortcuts don't works too...backspace don't delete the selection, and I don't need to work with javascripts, need a stupid ext... thanks!!!

metamax's icon
MrMaarten's icon

I also kindly hope that there will be a message to clear the max window from within a patch!

In the mean time... is that apple script of Luke Hall still available? I don't see it...

metamax's icon

Is there a security concern? The current format ensures that logs of certain lower level events and/or warnings will be seen by the user.

Or maybe Cycling doesn't want copyright notices to be cleared without user action?

Lee's icon

I don't think so. I asked them about this about a year ago and they said it was on the list of things to do... I guess they've just not got round to it yet... same as being able to copy from the MAX window in M4L...

loadmess's icon

In a 2009 email to Cycling requesting a shortcut to clear the Max window like "pure data" this was their reply:

"We have made the clearing of the Max window behave like any other programming environment, as it is a log of useful posts and errors. We kind of want to make it hard to wipe completely."

dhjdhjdhj's icon

Some time ago I built a little app along with an object called "udpprint" which "prints" stuff to a log window in that app via UDP. Would be trivial to add a command to "clear" that log window. I use that instead of 'print' for pretty much everything.

If people are interested in this, then I'm happy to make it available. It's only for the Mac though

EarHax's icon

Just in case anyone else stumbles upon this thread and isn't aware of the change introduced in 7.3.2, our wishes have been granted.

https://cycling74.com/forums/max-7-3-2-released

"Max: 'clearmaxwindow' message to Max"

Also, does anyone else notice that, lately, when clicking in the reply text entry form here, that the page scrolls to the top (using Chrome, Version 61.0.3163.100 (Official Build) (64-bit))? Has been happening to me for a little while and not sure why.

EarHax's icon

Or, for anyone familiar with the 'clear clip meters' shortcut in Pro Tools...

Max Patch
Copy patch and select New From Clipboard in Max.

Option+c will clear the max window.

I use a template and just added this in a subpatch with some other shortcut/workflow stuff so it is always there when I start working on a new patch.

Zach Alterman's icon

How does one use the clearmaxwindow message? I am sending it to a 'thispatcher' object and it doesnt seem to be working. What do I send the message to?

Zach Alterman's icon

Awesome, didn't know about the semicolon syntax. Thanks!

KllyShhn's icon

for those still wondering

maxwindowexample.maxpat
Max Patch

MakePatchesNotWar's icon

People from the past; i thank you for your service!