• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

JavasScript plugin help - environment variables

New Here ,
Mar 25, 2022 Mar 25, 2022

Copy link to clipboard

Copied

How do you read environment vars? Was hoping it was as simple as process.env.ENV_VAR, but that does not work.

 

Also, when using project.save, and isBusy() is true, what is the best way to wait until Substance is not busy and then save? I am basically creating a project and then saving it. For now I am using a setTimeout to 5 seconds which does the job, but maybe I can temporarily listen for the busyStatusChanged event when isBusy is true?

 

thanks!!

TOPICS
Scripting

Views

79

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 30, 2022 Mar 30, 2022

Copy link to clipboard

Copied

With the Javascript API we don't provide a way to access the environement, so retireving the env-var of the process in which the application runs it not doable.

(You can however access that information via the Python API with the regular os module.)

 

Regarding saving in case the project is busy, a Timer is probably the best indeed. That's how the autosave plugin works if I recall properly. You can take a look at it for inspiration.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2022 Mar 30, 2022

Copy link to clipboard

Copied

LATEST

Thank you very much for confirming. This will be a good reason for us to move to python to match the rest the of the pipeline.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources