Access Artboard Symbol properties

Hi, please someone tell me how to access those parameters as: blendMode, blur etc. from the Symbol of a selected Artboard.

 // if I use this code:
console.log(selection.items[0]);
// gets me the picture below:

image

I am trying to get the value of isFlowRoot for example but I cannot figure it out.

If an artboard is selected, then you can read the value of any of its properties like this:
console.log(selection.items[0].blendMode); // Outputs "pass-through"

I don’t think there is an " isFlowRoot" property. If you are interested in the document’s flows, you can see them like this:

const interactions = require("interactions");
console.log(JSON.stringify(interactions.flows));

for (let i = 0; i < interactions.flows.length; i++) {
    let flow = interactions.flows[i];
    console.log("Flow " + (i + 1) + " of " + interactions.flows.length);
    console.log("   name: " + flow.name);
    console.log("   homeArtboard: " + flow.homeArtboard.name);
    console.log("   url: " + flow.url);
}

No, actually there is a blendMode property of Artboard, but under Symbol there are more properties. I cannot access any of those.

In the debugger you might see private properties that are not accessible to the plugin API. The public properties for an Artboard are listed here, plus any that are inherited from GraphicNode and SceneNode.

1 Like

since they are visible under Symbol via console.log, why are they not accessible as any object property? :frowning:

The debugger can view the raw memory that backs an object, including private properties. There might be a way to hack at it to see information that is internal to XD, but the plugin APIs would not support that. Is there some specific node information that you are looking for that I can help you get access to via the public APIs?

1 Like

Well, among others, I’m particularly interested on isFlowRoot property of the Artboard > Symbol.

I mean, what are your trying to accomplish with your plugin? I don’t know what “isFlowRoot” is or how to access its value, but I’m guessing it might be related to the FlowInfo I mentioned above.

1 Like

isFlowRoot is a property of the Symbol of the Artboard that it tell you false or true, which is telling me if a selected artboard is also a root of a flow.

So I want to know if that selected artboard is the root of a flow.

I want to achieve something similar how isHomeArtboard works only for one artboard that is the home artboard of the entire document, but I want that for any FLOW.

That makes sense. This code will print to the console if the selected artboard is the home to a flow:

if (selection.items[0] instanceof Artboard) {
    let selectedArtboard = selection.items[0];

    for (let i = 0; i < interactions.flows.length; i++) {
        let flow = interactions.flows[i];

        if (flow.homeArtboard.name === selectedArtboard.name) {
            console.log("   Selected artboard \"" + selectedArtboard.name + "\" is home of " + flow.name);
        }
    }
}
1 Like

Thanks @DavidXD, that saved me.

I wonder if there’s any way to display all the artboards of a flow or of a cloud.getSharedArtifacts(links) ?