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

executing script from action, #targetengine problem

Engaged ,
Mar 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

I want to pass my_path = app.activeDocument.path, to second script

The first script is

 

#targetengine "my_path"
my_path = app.activeDocument.path;

 

The second script is

 

#targetengine "my_path"
alert(my_path);

 

Testing on different documents.

Running the scripts from menu File>Scripts the alert gives the corresponding document path

Running the first script from recorded action the alert gives the first document path

How I can have  the corresponding document path , while running the first script from a recorded action ?

TOPICS
Actions and scripting

Views

162

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 1 Correct answer

LEGEND , Mar 06, 2022 Mar 06, 2022

Without using actions you could try evalFile() method, with, you may try $.setenv / $.getenv methods.

Votes

Translate

Translate
Adobe
LEGEND ,
Mar 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

Without using actions you could try evalFile() method, with, you may try $.setenv / $.getenv methods.

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
Engaged ,
Mar 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

LATEST

Using $.setenv / $.getenv methods works fine with actions !
Thank you!

1st script

$.setenv("my_path" ,app.activeDocument.path);

2nd script

var myFolder_doc = $.getenv("my_path")

 

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