Copy link to clipboard
Copied
I'm running macOS Sierra.
In my ExtendScript code I have:
system.callSystem("echo $PATH");
This results in the following output in the ESTK's Javascript Console:
/usr/bin:/bin:/usr/sbin:/sbin
However, if I enter the same command directly in a terminal window, like so:
echo $PATH
The following is output:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
So it seems that ExtendScript operates in a different environment than the one my user has? I'm not understanding why the $PATH variable is showing differently in the two different contexts. The documentation for system.callSystem state:
Executes a system command, as if you had typed it on the operating system’s command line. Returns whatever the system outputs in response to the command, if anything.
Is there anything I can do ensure that the system.callSystem method makes use of my current environment path?
Thanks!
Alright, I found an answer that seems to work even after rebooting the system—so it's a permament fix. I found the answer a bit of the way down on this thread at AskDifferent:
Start a terminal session and enter the following.
sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Of course, instead of the specific path above, insert the environment path you want AE to have on macOS, then reboot the machine.
Any .bash_profile or .profile files in your Home directory will be hon
...Copy link to clipboard
Copied
Alright, so I pin pointed the issue, and have learned a new detail about the system.callSystem method. On macOS, callSystem seems like it sources the .bash_profile found in the user's home folder. Since upgrading to macOS, I added a .profile file that handled setting up paths, etc. So, I essentially had to create a .bash_profile file and setup the environment path in there. After doing that, AE loads with the same environment path.
So, that doesn't seem to be it after all. The issue is returning after a restart of AE and ESTK. Anybody have any ideas why this is the case on macOS Sierra? I don't have any older OSX installations so I cannot recall if the behavior is different for different versions of OSX.
On Windows, the user path is recognized when doing system.callSystem("echo %PATH%") — but when doing so, AE magically prepends the "Support Files" directory found within AE's application directory.
Thanks,
Arie
Copy link to clipboard
Copied
Alright, I found an answer that seems to work even after rebooting the system—so it's a permament fix. I found the answer a bit of the way down on this thread at AskDifferent:
Start a terminal session and enter the following.
sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Of course, instead of the specific path above, insert the environment path you want AE to have on macOS, then reboot the machine.
Any .bash_profile or .profile files in your Home directory will be honored when you start a Terminal session.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more