• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Script to call scripts with actions.

Community Beginner ,
Sep 10, 2024 Sep 10, 2024

Copy link to clipboard

Copied

Hello, I'm a complete begginer to Illustrator scripting and I hope you can help me with this problem. I'm trying to:
Call an action within an action set using Jsx. My problem is that using app.doScript() to call on the action does not load the steps in the action that uses scripts.

Ex. ACTION1
1. Alignment
2. Color
3. JSX Script

If I just run ACTION1 on its own, it completes all steps. But when I use app.doScript(), it runs steps 1 and 2, but gets a "currently not available" on step 3. I know that I can just use a single script to achieve the objective of all 3 steps, but I have multiple actions that have combinations of recorded steps + script so I can't redo them all.

Is there  a way around this?

TOPICS
How-to , Scripting

Views

80

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
Enthusiast ,
Sep 11, 2024 Sep 11, 2024

Copy link to clipboard

Copied

LATEST

This comes up quite a bit here actually. Basically, Ai ExtendScript is single threaded so when you initiate an action from a script (first thread) and that action tries to run another script (second thread) Ai is waiting for the first thread to end before it can move on to the second.

 

You could try calling the second script from within the first script like below or skip the use of an action and write those steps in the script (if doable).

 

// do you stuff from script one
var doc = app.activeDocument;

// call your action (without the other script call)
app.doScript("hey", "example");

// run your second script from here instead of the action
var s = new File(Folder.desktop + "/example.jsx");
$.evalFile(s);

 

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