Copy link to clipboard
Copied
Hi, on windows after setting the user env variable
$.getenv('myVariable') - works
On a mac it is null. From which place extend script tried to get the env variable on mac?
I researched google and did not find any info or ideas.
Yes, I did it) but then found `$.getenv` API which looks the better solution.
$.getenv('YOUR_NAME_VAR ')
Copy link to clipboard
Copied
Setting aside the use of DOS Prompt environment variables from withing PPro ExtendScript...What are you actually trying to accomplish? 🙂
Could you describe the workflow(s) you're trying to support, from a user's perspective? That'll help us provide better guidance.
Copy link to clipboard
Copied
Want save in user env variable `api url`. If user do not have I will use default from code. If it is dev or qa teammates they can set this env variable and extension will use different API URL
In current logic ppro looks at different folder with envs and it is hard to find on mac.
Copy link to clipboard
Copied
Confirming: You're writing a CEP-based panel, from which to execute your ExtendScript, right? If so...why not use a cookie, like the CEP HTML Test Panel does?
CEP_HTML_Test_Extension-10.0
Copy link to clipboard
Copied
Because the user should have possibly configured it manually. What is sence with cookie?
Env variable can be set and CEP will use it.
Copy link to clipboard
Copied
I don't understand; reaching out, directly.
Copy link to clipboard
Copied
All right, thanks for the fast response. I will try explain more clearly.
The idea is to have the possibility to change API URL in run time CEP extension. It should be hidden from the user. It is mean we should not have a toggle inside UI CEP extantion.
$.getenv is suitable for this task because it can be initially stored without interaction with the CEP extension.
The cookie can not initially be set without CEP interaction.
Copy link to clipboard
Copied
You could save the value in a text file, once user sets it.
If (text file present) and (valid value in text file) --> use value in text file
else (use default value in panel's javascript code).
Copy link to clipboard
Copied
Yes, I did it) but then found `$.getenv` API which looks the better solution.
Copy link to clipboard
Copied
$.getenv('YOUR_NAME_VAR ')