Undocumented textjustification syntax

Jul 3, 2013 at 5:24pm

Undocumented textjustification syntax

Stop me if you’ve heard this before. I stumbled on it while fiddling with attrui, trying to figure out why my scripting failed.

Dig it: textjustification attribute values “left”, “center” & “right” must
be sent as “0″, “1″ & “2″ respectively.

Try it with textedit, message box or comment:

Sending

“textjustification 1″

centers text. Sending

“textjustification center”

doesn’t.

This also seems to go for sendbox messages, script sendbox messages to thispatcher, and the corresponding javascript for all of the above.

Max 6.1.3 Mountain Lion

#254910
Jul 3, 2013 at 7:19pm

whoa, center-justified message and comment boxes? I’ve wanted those for ages…!

gotta try it out…

#254923
Jul 4, 2013 at 7:47am

Yes, this is new to Max 6.1.3.

@radio wonderland: this is the expected behavior, textjustification takes an int as argument.

<code>

– Pasted Max Patch, click to expand. –

</code>

#254962
Jul 4, 2013 at 8:35am

Yes, it’s there if you look at attrui, but nowhere in the documentation as far as I can tell. So is attrui a better guide than the reference pages?

#254967
Jul 5, 2013 at 11:23pm

The reference says the argument is an int. Although it would be nicer if you would see the numbers… Request noted.

#255068
Jul 6, 2013 at 6:10am

Whaat? Imposs–

Oh. What was I looking at? I don’t know. Maybe some examples. Oops.

While I have you on the phone? This also stumps me, in scripting objects–why function-like syntax assigns values to attributes, but in at least one case that fails and assignment-like syntax works instead. (I sort of intuitively get it, but I don’t really understand.)
tempObj.presentation(1); //right syntax
tempObj.bgcolor(1, 1, 1, 0.25); //right syntax
tempObj.readonly(1); //right syntax
tempObj.fontname("Helvetica"); //right syntax
tempObj.fontsize(96); //right syntax
tempObj.patching_rect(coords); //right syntax
tempObj.varname(name_it); //wrong syntax!!!!!!!!!!!!!!!!!!!!!!!!!!
tempObj.varname = name_it; //right syntax

But there are more important things. Like polybuffer~ .

#255081

You must be logged in to reply to this topic.