Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Problem with a step by step live " animation"

New Here ,
Aug 21, 2022 Aug 21, 2022
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
166
Translate
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
Community Expert ,
Oct 30, 2022 Oct 30, 2022

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

@m1b  perhaps?

Translate
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
Community Expert ,
Oct 30, 2022 Oct 30, 2022
LATEST

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

Translate
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