Yes, it looks like the comments for the units param are the wrong way round.
You can only change the document units from code when reading/creating a document. You can't change the units of an existing document. See this thread:
OK, but what means "reading a document" in SDK therms?
I have read fully that article. IMHO, logically, would be to set the documents units and the ruler to adapt automatically to that...
Is that possible? The article si from 2010...
Reading a document means you are processing a kCallerAIFileFormat kSelectorAIGoFileFormat message.
I don't think anything has changed since that thread. Not sure what you mean when you say "IMHO, logically, would be to set the documents units and the ruler to adapt automatically to that"
I mean, if I set some document's units to be centimeters, the ruler to be in centimeters automatically.
If you change the document units in the GUI, the ruler units update automatically. In code, I think you can also only set the document units when creating/reading a document, so I don't see how this would help.
Indeed. Naturally, I don't see why to set the ruler units in order to set the document's units.
Anyway, document's units should be possible to change using the SDK.
Shame Adobe did not implement SDK functions in ExtendScript Toolkit...
How are you going to change the document units? There is a SetDocumentSetup function, but again this can only be used when reading a document.
I am not. It was an "in theory" statement... That's why I say "should" instead of "is possible" or "will change"...
It is simply a wish.
I don't know why I insist on this, I know Adobe never listens to our wishes, as Photoshop and Illustrator to be on Linux or providing a full SDK or scripting tool.
Wonderful art could be created with scripts that is not possible with hand drawing.