Skip to main content
Participant
August 21, 2022
Question

Problem with a step by step live " animation"

  • August 21, 2022
  • 2 replies
  • 171 views
Hi everyone!
I am a beginner in InDesign scripting,
I can't solve this embarrassing problem...

When I create an "animation" step by step, my animation runs well live on my screen.
In the example I add +1 in tracking each segond, and the "animation" is well done in live in Indesign

But when I add an alert before my fuction, or any other UI script element, or a simple Script Ui with a button to run my script, my script works but it does not "animate" anymore.
 
Another strange thing, when I run my script from Visual Studio Code the animation works, but when I run my script directly via the indesign script panel, sometimes the animation doesn't run even if I don't have any popup dialog before

Thank you in advance for your response,

(This message was translated with a translator, sorry for the potential problem of translation, I hope my message was clear)

 

 

0zera

// the animation works without the alert, 
// but when I add the alert my script works but it does not animate anymore
alert("Animation")

function animation() {
    for (var i = 0; i < 15; i++) {
        $.sleep(1000)
        app.selection[0].tracking = i;
      }
}

animation();

 

 

This topic has been closed for replies.

2 replies

m1b
Community Expert
Community Expert
October 30, 2022

Hi @jérémiec7588316, how are you realising your animation? Exporting jpegs of each "frame"?

You could try getting a reference to a textFrame (for example) and doing myTextFrame.recompose();

But I'll need to understand what you're doing and how you are doing it. What's the point in making Indesign animate the tracking in your example? What do you do with it? I'm intrigued! 🙂

- Mark

Community Expert
October 30, 2022

I have no idea on this one - perhaps one of the regular scripters here can help you

@m1b  perhaps?