I have an ID. It's currently an integer.
I want to know if there's a Document with that ID, or if there's a Folder with that ID. Why? Because if I guess and try to put it in the document() function, it will crash if it's a folder. If I guess and try to put it in the folder() function, it will crash if it's a document.
I've tried plugins, but the plugins have a super fun tendency to throw lots of Java errors destroying our logs whenever we try to find out if this stupid thing is a Document or a Folder.
Is there a way to do this out of the box? I want a rule that receives an integer and outputs the word "Document" or the word "Folder" or the word "Neither" and DOES NOT PINK BOX no matter what integer is.
Discussion posts and replies are publicly visible
For some reason it's impossible for me to use the property() function on a document or on a folder.
Unknown said:use the property() function on a document
What makes you think this would work? AFAIK that has nothing to do with what property() is intended to do.
I want to get the "name" property of whatever kind of object it is.
See, the toDocument function works on an ID, and the toFolder function works on the same ID. If it's REALLY a document, it will be a document with document properties like a "name" and an "extension", otherwise, they'd be null. That could be a test, if only the durned thing worked.
So I can't get the "properties" of a document out of the property() function, only via the document() function. But only the property() function gives me a default value if it's not there to avoid the pink box.
But that's not what property() does - it gets a CDT property, from a CDT. The result of document() is not a CDT. Also, I believe document() needs to be called on one named document-property at a time.
Unknown said:only the property() function gives me a default value if it's not there
See my separate answer - the plugin and function I named does provide a non-error result when the provided ID is invalid.