Hello! I'm creating a .command file from my illustrator extend script to interact with the terminal. But when I try to do file.execute() it's telling me that it can't be executed since I don't have the appropriate access privileges. This can be fixed manually if edit the file and do something like chmod u+x 777 on the .command file, but for this script it needs to create and delete the command file when necessary.
What I did for one of my projects is create a .command file manually and give it execute access using the chmod command. Then in the script I used this base .command file, opened it wrote the new commands saved it, and then executed it. Hope that works for you as well
Hello Manan, This could be a potential solution. Currently my script creates and destroys this .command file during runtime and it works fine on windows. I'd have to refactor some code but it could work. I am still curious if there is a way to set the permissions of the file at creation though, but thanks for the answer.
I was not able to find any other way. One possible approach could be to create the file, use Applescript to change its permission(I think we can launch AS from within JS). I would be interested to know what you finally come up with.