Copy link to clipboard
Copied
Hello, I have a dockable jsx script that I've rolled into an extension (because I need to do some fetch requests before loading it). So basically the CEP panel is only to make use of node js, authenticate the user, then it just needs to load the jsx where everything else will happen. I just can't seem to figure out how to load the jsx as dockable (as if it was run from ScriptUI folder). If there's no way to launch it as a dockable panel, is it possible to have it replace the contents of the extension panel (which is already dockable and has no use once the user is authenticated)?
I just really want to avoid rewriting my jsx code to hook up to CSinterface, since it already works fine and is just missing the dockable feature. Any ideas on this?
Thanks!
Copy link to clipboard
Copied
As far as I know, dockable jsx scripts can only be created by installing the jsx into the Script UI Panels folder and then launching it from the Ae menu. Maybe your cep panel can execute the menu command with app.executeCommand?
Copy link to clipboard
Copied
Thanks for that suggestion - I think ordinarily that could work but I need my script to only be run by someone who has authenticated through the CEP panel
Copy link to clipboard
Copied
Then your only option is most likely to implement your user interface as a CEP panel and not with script UI.
Alternatively, you can save the jsx as a string inside your CEP panel code and then use csInterface.evalScript
to execute it. But this will have the limitation that you don't have a dockable panel.
If you want to disallow usage without autentication in a relibale way, also keep in mind that whenever you have the jsx in a file as part of your panel, any user could simply copy this file to the "ScriptUI Panels" folder and use the file standalone. Hence, embedding it in the CEP panel code and obfuscating the CEP panel code is the better option.
Copy link to clipboard
Copied
Ah I see, thanks for that. I don't suppose there is any way to make a fetch request to an api purely through extendscript then? Say the script already has the access token and the api url, and just needs to perform a check? I could possibly eliminate the issue entirely this way, but as far as I can see there isn't a way to do it.
Thanks again!
Copy link to clipboard
Copied
Actually, I just realised you can use curl - that solves my issue! Thanks