Problem with a step by step live " animation"

New Here ,
Aug 21, 2022 Aug 21, 2022

Copy link to clipboard

Copied

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();

 

 

TOPICS
Scripting

Views

31

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation