Open edwardfxiao opened 1 month ago
I don't know about windows, but for macOS, you can replace
if (process.platform === OSX) {
let script = `tell application id "com.adobe.Photoshop" to do javascript ("#include ${pathTojsx}")`;
osascript.execute(script, cb);
}
to
if (process.platform === OSX) {
let script = `tell application id "com.adobe.Photoshop" to do javascript ("#include ${pathTojsx}") with arguments "{filename: '${editor.document.fileName}'}"`;
osascript.execute(script, cb);
}
Then I can get the filename
like this:
if (typeof JSON === 'undefined') {
var JSON = {
parse: function (str) {
return eval('(' + str + ')');
}
};
}
var actualFilename = "";
try {
var option = JSON.parse(arguments[0]);
actualFilename = option.filename;
}
catch(e){}
Till vscode-to-photoshop handle this,
I have created vscode-to-photoshop2-with-real-path if anyone has the same need.
Thanks again for this great extension @bialikover
Hi, very useful project! But I am having trouble to get the real JavaScript file path
Right now when executing
it outputs
~/.vscode/extensions/bialikover.vscode-to-photoshop-0.0.3/out/src/tmp_file.jsx
, while the actual file is located in~/my-photoshop/scripts/script-1.js
, and I understand the logic behind.But is it possible to get the actual path? Because I somehow need to load the action file(
~/my-photoshop/actions/action-1.atn
or../actions/action-1.atn
for example) in different directory, and I would change theaction directory
ordirectory depth level
from time to time.