Copy link to clipboard
Copied
>apiCall returns an object.
Then that can never work.
Anything you pass across the ExtendScript <--> JavaScript boundary has to be a simple, contiguous String.
It seems that if you pass a string, not an object, it'll work.
> But still the premiere pro is not able to receive the output of the api call.
I have no idea why your JavaScript code fails to work.
The example code I've referenced above, works.
Please base your development on the working examples provided.
Copy link to clipboard
Copied
What does apiCall() actually return?
Copy link to clipboard
Copied
apiCall returns an object. Here's the code if it helps and the updated code I am using
Copy link to clipboard
Copied
>apiCall returns an object.
Then that can never work.
Anything you pass across the ExtendScript <--> JavaScript boundary has to be a simple, contiguous String.
Copy link to clipboard
Copied
That's right but if you would look at the third line of the function apiOutput0() I have used the JSON.stringify() on the object. So, I guess that solves the string problem, right?
Copy link to clipboard
Copied
Perhaps; what do your results show? Do you get different results, if you instead pass a hard-coded string?
I referred you to this working example of passing data between JavaScript and ExtendScript; where does your usage, depart from the example?
I'm not clear why you're adding two sets of punctuation around Result, when you pass it to evalScript...
Copy link to clipboard
Copied
When I pass a hard-coded string I get the expected results i.e the string gets alerted as it is.
Copy link to clipboard
Copied
It seems that if you pass a string, not an object, it'll work.
Copy link to clipboard
Copied
In that case we have already seen that JSON.stringify doesn't work so how do I send it as a string
Copy link to clipboard
Copied
I'm not sure what's not working in your panel.
PProPanel contains multiple examples of building up a String containing a function call and programmatically built parameters.
Where does your panel's usage, depart from these?
https://github.com/Adobe-CEP/Samples/blob/9efca02ea88ad32a8c22571f5ffe2407ae732cd8/PProPanel/index.h...
Copy link to clipboard
Copied
Hey I have made some progress and the ouput being an object is not causing issue anymore.
But still the premiere pro is not able to receive the output of the api call.
In the attached screenshot you can see that there are 2 functions. The first function makes the api call and flattens the output to a string. And the second function sends data to premeire. But when it is called premiere shows not output. So, I put some alerts to check what was working and what wasn't. So when this function is called only the first alert works and then it doesn't respond or return any alert after that which probably means that the line "const result = await apiOutput0();" is never executed. That line works fine when checked in the js using console.log but while sending to jsx nothing gets executed after that line.
(Also the api call takes a few seconds to generate the output so I put the setTimeOut there but idk if that serves any objective or not)
Copy link to clipboard
Copied
> But still the premiere pro is not able to receive the output of the api call.
I have no idea why your JavaScript code fails to work.
The example code I've referenced above, works.
Please base your development on the working examples provided.
Copy link to clipboard
Copied
The difficulty I am facing is that JSX is not recognizing 'await'. When I wrapped my code in try/catch statements I found that JSX proceeds further right away without waiting for await function to complete. The code you referenced has no use or inclusion of such functionality.
Copy link to clipboard
Copied
That makes complete sense, as ExtendScript is ECMA3, and JavaScript is ECMA6. 🙂