Forum Discussion

ChrisPim-f7a22b's avatar
ChrisPim-f7a22b
Community Member
18 days ago

Get position of a slide object

Using the current API, does anyone know how to get the position of an object on the slide and pass the x and y position in variables?

I tried using ChatGTP to write the code which suggested two versions, neither of which worked...

Chris

2 Replies

  • Paul_OConnor's avatar
    Paul_OConnor
    Community Member

    This should do the trick:
    const circle = object('5sag6LU0aSc');
    setVar('cX',circle.x);
    setVar('cY',circle.y);

    For this I had a circle object on the slide (object ID: '5sag6LU0aSc') and created the Storyline variables cX and cY as numbers.