Skip to main content
Participant
June 5, 2023
Question

Issue With Declaring Window Object in Extend Script

  • June 5, 2023
  • 3 replies
  • 417 views

In my .jsx file I have the following function:

function showForm(filePath, dataPath)
{
  alert("Before");
  var dialog = new Window("window", "Select a folder");
  alert("After");
  dialog.show()
}
However, the second alert never appears indicating the code hangs on the Window object declaration.

Any ideas on why this may be?
This topic has been closed for replies.

3 replies

Mathias Moehl
Community Expert
Community Expert
June 6, 2023

Do you get any error messages when running it with the debugger active?

Also, are you sure you run the script with After Effects as host app? Premiere Pro is missing lots of the UI stuff, for example.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Dan Ebberts
Community Expert
Community Expert
June 5, 2023

Just running your function in ExtendScript Toolkit, I get a different behavior. I get the first alert, then the tiny window opens briefly (then disappears) and then I get the second alert. Don't know if that's helpful.

Participant
June 5, 2023

Just to clarify this is for an extension. This function is called by a JavaScript function that a button calls. I know this showForm function is called because I can see the first alert. Interestingly this works if I run it as a script.