All about (thispatcher) scripting
Feb 19 2020 | 10:11 pm
I'm trying to up my skills with regards to scripting in max (thispatcher scripting that is). For some reason I feel that the help patch and reference page for thispatcher is not complete. For instance, I came to realize that there is a message "script replace" that is not listed anywhere, and I am having difficulty really understand how to accomplish some things like change the color of an object. Regarding the latter, it puzzles me that if I send "script sendbox varname color 0. 0. 1. 1." not only max complains that there are extra arguments but it will also paint it white instead of blue.
Any help, good references, or otherwise words of encouragement are greatly appreciated.
- Feb 20 2020 | 12:39 amYou are going to do some Max archeology here... For border color try "script sendbox varname bordercolor 0. 0. 1. 1."
- Feb 20 2020 | 5:18 amThx @KLSDIZ but that doesn't do anything.
- Feb 20 2020 | 5:35 pmhi, it's better if you post a patch: in your examples, you're doing two things which seem off- 1) you use "varname" when 'varname' is really a code-word for substituting the scripting name of the object there 2) i've not seen any objects with any attribute called 'color', in a number box, it's called 'bgcolor', in a message object it's called, 'bgfillcolor'...look in the object's inspector, make sure the object has a 'scripting name' in its scripting name field and use that name as a substitute wherever instructed to use the word 'varname', and also in the inspector, at the bottom of the inspector window is an '@' icon which allows you to hide/show attribute names. Make sure that is set to show them, and then make sure the attribute you are trying to set is spelled correctly as its listed there in the inspector.here's an example with a flonum object having its 'bgcolor' set:i agree with you: 'thispatcher' helpfile could give more detail on how to look through an object's inspector to find exactly what you need(Cycling74 probably cover attributes and the inspector window somewhere else in the docs and thus ended up leaving that stuff out of the 'thispatcher' helpfile), so this slight gap in easy-access to relevant info. ends up happening every now and then in the docs because there are so many areas which can get covered as their own topic its hard to anticipate where topics overlap. hope this helps.
- Feb 20 2020 | 9:01 pmHi @👽R∆J∆ THE RESIDENT ∆LIEN👽 yes, varname is the scripting name for the object in question. For the time being, and to avoid further confusion let's assume then that I am referring to my coll object, whose scripting name is colly, and I want to change the Border Color. There IS a color attribute, it is the attribute name for Border Color. Have you tried it out? sending "script sendbox colly color 1. 0. 0. 1." to this patcher will change it to light brown (?) and not red! It seem as if it is expecting only one number between 1 and 16... I would really like to set rgb colors.Also I am not expecting to see any info regarding the scripting types of messages in the middle of attributes and inspector documentation. "Script replace" afaik is completely absent from documentation. I wonder what other scripting messages are absent too and if there is a place where one could REALLY learn more about scripting messages.
- Feb 20 2020 | 10:05 pm
- Feb 20 2020 | 10:12 pmHey @KLSDIZ I opened your patch, which contains what you suggested before, but it doesn't change the color. Does it work for you? I'm on Mac OSX 15.3 Max 8.1.2. Would you mind sharing your setup here?
- Feb 20 2020 | 10:46 pmOk, I see the problem.It seems that you need first set legacy numbered color (to anything) via "color" attribute, and then you can change proper color using "bordercolor" attribute. This is either a bug or a workaround for some backward compatible behavior.
- Feb 20 2020 | 11:04 pmwhat in the world... you nailed it! Thank you very much for that one.I would love to learn these quirks. If you could direct me to some good spots for Max archeology, I'd greatly appreciate it :)Several months ago I had a scripting problem with initiating an object with a couple parameters, one of which needed to be inside quotes. (It was probably just a matter of finding the correct way to escape characters?) I can't find that example now, though. Have you dealt with things like these?Again, thank you very much.
- Feb 21 2020 | 11:07 amin old times you just exported a patch with the object in question as textfile - then you knew how to script-create it. a good resource for object scripting doesnt exist i think.
- Mar 12 2020 | 8:44 pmJust saw this in the release notes for 8.1.3:
object box: color attribute works as expectedthough, it is taking like an hour to download the update... I don't know if it is on a slower server than usual, or if there is just too many people at home (cough cough) hogging my supposedly gigabit connection.
- Mar 12 2020 | 10:16 pmYup, they fixed it! (Thanks Cycling74) now, about the thispatcher scripting messages thorough documentation... :D ?
- Mar 13 2020 | 4:02 am"it is one of the 16 "boxcolors" you had in max 4" I was not even born at that time! Jk I probably was, but I only became aware of max and started using it by the end of max 5. I wouldn't mind joining Cycling74 for the summer just to work on this and help create new documentation for it... (*wink wink* @Cycling74) :D
- May 24 2020 | 5:09 am