Copy link to clipboard
Copied
Dear All,
I'm unable to run / execute the external shell file using through UXP scripts. We tried to use the below reference but unable to do that through UXP.
Actually, I created the shell file (.sh) in local folder. I have to run the shell file through terminal.
https://developer.adobe.com/xd/uxp/uxp/reference-js/Modules/shell/Shell/
We tried to include the normal File.execute into UXP then, that also showing the File error.
Kindly can anyone help me on this and will appriciate 🙂
Thanks & Regards,
Harihara Sudhan T R.,
Then, call which node in the terminal. Once you get the full location for Node bin, use it in your bash command
instead of
node .
use
/whatever/path/which/returned/to/node .
Copy link to clipboard
Copied
The linked page is pretty explicite. The module shell in the context of UXP seems to offer two methods only. They mainly consists in opening locations, not executing commands.
If I test shell.openPath, then it behaves as expected.
So if you want a bash file to be ran, you need a different approach. UXP doesn't seem to include the exec or spawn module. However you can use doScript to run an applescript that runs the bash file.
The following seems to do the trick:
var scpt = 'do shell script "bash /path/to/file/cmd.sh"';
app.doScript(scpt, ScriptLanguage.APPLESCRIPT_LANGUAGE);HTH
Loic
Copy link to clipboard
Copied
Dear Loic,
I tried to call the Node script from Bash file :
//================================
Script File :
Copy link to clipboard
Copied
/Desktop/HTMLDownload/htmlcalling.sh: line 2: node: command not found"
By @Harihara28692478zxj6
Excuse me for asking but is Node actually installed on the machine? Given the message you get, I doubt about it. But if yes, you may simply have an environment variable issue:
https://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04
Does the same command works in the terminal?
Copy link to clipboard
Copied
Dear Loic,
Thank you for your support!
1. Yes, I installed NodeJS in my mac OS.
2. I runned the below command with in the terminal manually
//=====================================
username@<MachineName> ~ % bash /Desktop/HTMLDownload/htmlcalling.sh
//=====================================
It is running perfectly and deliver the output file which I mentioned path in the nodeJS
So that, any idea to run and fixing this issue.
Thanks & Regards
Harihara Sudhan T R.,
Copy link to clipboard
Copied
Then, call which node in the terminal. Once you get the full location for Node bin, use it in your bash command
instead of
node .
use
/whatever/path/which/returned/to/node .
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more