List appearing after prompt
Thank you for taking the time to look at this posting!
I hope this is a simple problem. I have a script that displays a list of choices, and then I prompt the user to select one. My problem is that the prompt appears before the list. I tried to insert an “alert” just after running the line to display the list (testFrame.contents = variable). I tried to sleep for a while – computer didn’t like but I did. Not sure where to go from here.
The following is a test script created to demonstrate the problem:
// Add a text Frame - called myIdeaList
var myIdeaList = app.activeDocument.textFrames.add();
// Set font for list
myIdeaList.textRange.characterAttributes.textFont = app.textFonts.getByName("Cent");
// Set size of characters in list
myIdeaList.textRange.characterAttributes.size = 24;
// Set position of list
myIdeaList.position = new Point(50, -50);
// Display list of ideas
myIdeaList.contents = ("Work on script\nClean your Cave\nPick your nose\nTake a Nap");
// Ask to select one from list
var NeXT = prompt("Please pick an idea from the list", "", "Have a pick but not your nose.");
// Display which item selected
alert (NeXT);
Thank you for your advise!
