Javascript getName

Hi,

I have troubles succeding to code what I want Toonboom to do: I want it to get the name of the layers I manually select so I can modify them after.

  • I manually select the nodes in the network (I also tried by selecting the columns in the Xsheet)

  • then I launch my script with:
    column.getName(selection.selectedColumn(i))

But I do not get any thing at all. I tried creating a var to replace selection.selectedColumn(i), then i get “Drawing” for any node I select.

I need to get the unique id of the layers I manually select.

Can any body help me achieve this?

Two weeks and still no help?

Am I not posting this in the right section?

Could anyone at least give me another forum where I can ask for help about this?

Hi .S_L.,

welcome to the rude world of research for information on scripting in Toonboom Harmony. :slight_smile:

Let me ask you one question:
Are you looking for the names of the selected columns or of the selected layers?
If you wanted to get the names of the selected layers in the timeline, using ‘node’ instead of ‘column’ would work:
node.getName(selection.selectedNode(i))

Am I not posting this in the right section?
Could anyone at least give me another forum where I can ask for help about this?

Well, I think that this is already the most appropriate place to ask this kind of questions. But indeed, this forum completely lacks moderation and support from the Toon Boom’s officials.

And, when it comes to scripting questions you can really be rapidly lost as all the information about this topic are spread somewhere in the forum.That’s why I suggested a while ago to create a separate forum section gathering all topics about scripting:
https://forums.toonboom.com/harmony/support-and-troubleshooting/forum-new-separate-board-scripting-scripts-script-modules-and-ex#new

If you feel that his could be helpfull for you as well you could drop a little line to support that topic.

Hi Stefman,

Thanks for you answer, I see I’m not alone in those depths!

I started my code using ‘node’ instead of ‘column’ as it was, at least, giving me the name of the selected layers. But the problem is the same, I can’t use the command to modify the exposure of the column.

I really need the long id of the column selected in order to modify its exposure. This is what I can’t succeed. If I create a selection with the javascript, it works, but this is not what I want. I need the user to be able to manually select the wanted layers, then launch my script, this one must be able to get those ids, but how? It is like if the nodes manually selected do not select the linked columns.

I’ll forward my code soon, I do not have it here at my reach.

Did you ever figure this out? I’m trying to record the start and stop times of each new drawing in an array before collapsing the layer into a single framed exposure for each drawing.

Hi !

I think what you need is that :

var myNode = selection.selectedNode(0); //Here you store the selected node.
var columnIdx = node.linkedColumn(myNode ,“DRAWING.ELEMENT”); //Here you get the name of the column linked to your selected node
MessageBox.information(columnIdx);// to be sure I print it in a MessageBox.

As simple as that.

Hope it helps.

Let me know.

Cheers