Photoshop CEP panel and user jsx path
I'm making a CEP panel in photoshop and i'd like to specify a folder that is not in the extension in which to run scripts.
This is the code im currently using.
var csInterface=new CSInterface,gExtensionId="testPanel", event=new CSEvent("com.adobe.PhotoshopPersistent","APPLICATION");
event.extensionId=gExtensionId;csInterface.dispatchEvent(event);
function onLoaded(){
var a=new CSInterface;b=a.hostEnvironment.appName;"FLPR"!=b&&loadJSX();
for(var c=["PHXS"],e=0;e<c.length;e++){var d=c[e];if(0<=b.indexOf(d)&&(d=document.getElementById("btn_"+d)))d.disabled=!1}updateThemeWithAppSkinInfo(a.hostEnvironment.appSkinInfo);
a.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,onAppThemeColorChanged)}
var extensionRoot=csInterface.getSystemPath(SystemPath.EXTENSION)+"/jsx/scripts/";
function loadJSX()
{
var a=new CSInterface,c=a.getSystemPath(SystemPath.EXTENSION)+"/jsx/";
a.evalScript('$._ext.evalFiles("'+c+'")')}
function evalScript(a,c){(new CSInterface).evalScript(a,c)}
function openUrl(a){csInterface.openURLInDefaultBrowser(a)}
$(document).ready(function(){loadJSX();
$("#1d-1").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'1d-1.jsx")')});
I don't understand every line of it but it does work.
As well as having the /jsx/ folder in the extension i'd like to use other path.
The user folder.
/user/Creative\ Cloud\ files/folder1/jsx
