paste in indesign window

Here is the situation

I’m making a script for Indesign, the script calls another script in the script panel.

That part is fine it works.

When it runs the 2nd script there is a user interact window that open in Indesign, if I’m using it outside my applescript (I mean directly by double-clicking the script in the script panel), there is a place to type in text, i’m able to use the keyboard and insert the information without touching anything before. But when applescript calls it, I can’t use keystroke or paste or anything else that will fill the highlighted part of the window where the text should be entered.

If someone can give me a hand on that it would be great, i wasted a lot of time trying to figure it out!

Thank you

You’re not going to be able to call the 2nd script that way. The first script is running, and actually doesn’t finish until the 2nd script does its thing and finishes- which it never will, since your 1st script is still in the foreground, and that’s what’s blocking the text input.
I suggest you find a better way of calling the 2nd script, or using a library or other method to load it and run inside the first script, or put the dialog inside the first script and just pass the value to the 2nd, etc.

Thank you for relying, I will try to find another. That 2nd script is a third-party plug-in in javascript language wich I know nothing!