I’m creating a new constant and trying to set it’s properties using this script:
DoCommand(“NewConstant”)
ChangeDeclaration(“Pi”, “3.141527”, “Number”, 0, “”)
I am getting an “Unhandled NilObjectException in XojoScript on line 0” error when the ChangeDeclaration is executed. I had hoped this would work because the declaration is similar to a Property declaration.
I have also tried PropertyValue(“Untitled.Name”) = “Pi”, but that does nothing (neither does “Untitled.ConstantName”). Is there a secret property name that’s not obvious?
I know there is the ConstantValue() method, but that only does one of the four things (Name, Value, Type, Scope) that need to happen.
Is there any hope for me here?