Copy link to clipboard
Copied
Hello there,
I am trying to send some data from JSX to JS, but the async operations are unreliable.
I return from JSX a folder path and then I try to commit a mutation to vuex, but it works like a lottery...
I tried using promises with no result. I increased the timeout to 1000 but it also kinda doesn' work all the time.
Copy link to clipboard
Copied
Moving to Photoshop Scripting from Photoshop
Copy link to clipboard
Copied
Better if placed in this forum
https://forums.adobe.com/community/creative_cloud/add-ons/extensions/content
Copy link to clipboard
Copied
In this case, You can use PlugPlugInterface.
You can reference below sample.
Copy link to clipboard
Copied
First off, it is important to note that the evalScript function has some consistency issues when it comes to its classification as "asynchronous".
Second, why are you using $nextTick outside of the callback? Why not simply commit to the Vuex store in the evalScript completion callback?
chooseExportPath() {
const cs = new CSInterface();
// Call JSX for folder path
cs.evalScript("choosePath()", (result) => {
const exportPath = document.getElementById('pathExport');
exportPath.value = result;
this.$store.commit('setExportPath', result);
});
}
Notes: