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

How to $.getenv on Mac your custom variable

Explorer ,
Dec 06, 2022 Dec 06, 2022

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.

TOPICS
SDK
2.2K
Translate
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

correct answers 2 Correct answers

Explorer , Dec 07, 2022 Dec 07, 2022

Yes, I did it) but then found `$.getenv` API which looks the better solution.

Translate
Explorer , Mar 23, 2023 Mar 23, 2023
Here how to set variable on Windows
Note: add in User variable not System

 

Here how to set variable on Mac
 
launchctl setenv YOUR_NAME_VAR "new_value"

in ppro

 

$.getenv('YOUR_NAME_VAR ')

 

Translate
Adobe Employee ,
Dec 06, 2022 Dec 06, 2022

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.


Translate
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
Explorer ,
Dec 06, 2022 Dec 06, 2022

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.

Translate
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 ,
Dec 06, 2022 Dec 06, 2022

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


Translate
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
Explorer ,
Dec 06, 2022 Dec 06, 2022

Because the user should have possibly configured it manually. What is sence with cookie?
Env variable can be set and CEP will use it.

Translate
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 ,
Dec 06, 2022 Dec 06, 2022

I don't understand; reaching out, directly.

Translate
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
Explorer ,
Dec 07, 2022 Dec 07, 2022

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.

Translate
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 ,
Dec 07, 2022 Dec 07, 2022

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).

Translate
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
Explorer ,
Dec 07, 2022 Dec 07, 2022

Yes, I did it) but then found `$.getenv` API which looks the better solution.

Translate
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
Explorer ,
Mar 23, 2023 Mar 23, 2023
LATEST
Here how to set variable on Windows
Note: add in User variable not System

 

Here how to set variable on Mac
 
launchctl setenv YOUR_NAME_VAR "new_value"

in ppro

 

$.getenv('YOUR_NAME_VAR ')

 

Translate
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