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

How to $.getenv on Mac your custom variable

Explorer ,
Dec 06, 2022 Dec 06, 2022

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.

TOPICS
SDK

Views

1.5K

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

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.

Votes

Translate

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

 

Votes

Translate

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

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.


Votes

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

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.

Votes

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

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


Votes

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

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.

Votes

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

Copy link to clipboard

Copied

I don't understand; reaching out, directly.

Votes

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

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.

Votes

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

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

Votes

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

Copy link to clipboard

Copied

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

Votes

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
Explorer ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

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

 

Votes

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