Skip to main content
Participant
December 21, 2022
Answered

Script/preflight

  • December 21, 2022
  • 2 replies
  • 664 views

Hello,

 

I'm mostly looking to pick someone's brain that may have more experience in this than myself. I think this could be solved with a script of some kind.

 

The two PDFs attached are basically sheet label templates. where you drop the artwork into the designated spot to kind of get it in place of where it needs to print minus mechanical shift etc...

 

My main questions are. Can a script be made to read an Action in illustrator based on the document's name? So for example, if the document I'm in is SL1538, Run an action made for document SL1538 to auto-fill in the template. The action will basically be a step and repeat of whatever the template is.

 

Or if there is a way to script a way to paste a artwork contained within a clipping mask and have it layout the artwork itself into each of the cavities based on differing margins.

 

I feel either are probably very complicated...

 

Granted that's also an obscene amount of actions to have to be installed at a time since we have over 6k templates between our different print methods. So I'm not sure it's even feasible.

This topic has been closed for replies.
Correct answer femkeblanco

Yes, you can run an action from a script. 

 

To run an action whose name is the same as the name of the document (presuming, for example, that it's in the "Default Actions" set):

app.doScript(app.activeDocument.name.replace(/\.[^\.]+$/, ""), "Default Actions");

 

2 replies

m1b
Community Expert
Community Expert
December 21, 2022

Hi @bradyh15378259, I'd say your task is *itching* for automation! I'd recommend hiring a good scripter to make a single script and a user-editable configuration file that handles all your different templates. Creating an action for each template seems quite unwieldy. I do a lot of this sort of thing. PM me if you'd like to discuss further. We'd need to know a bit more about your setup and see a range of your template files. - Mark

femkeblanco
femkeblancoCorrect answer
Legend
December 21, 2022

Yes, you can run an action from a script. 

 

To run an action whose name is the same as the name of the document (presuming, for example, that it's in the "Default Actions" set):

app.doScript(app.activeDocument.name.replace(/\.[^\.]+$/, ""), "Default Actions");