Skip to main content
Participant
November 14, 2024
Question

Script for dashed lines in illustrator

  • November 14, 2024
  • 3 replies
  • 641 views

Hey all, 

 

I have to make a lot of technical drawings of garments at work, and i've been trying to create a script that would allow me to make different types of dashed lines super fast.

 

The script I use (or at least want to use) is supposed to offset the line to a given distance (this part works like a charm), and then transform the new line into a dashed line.

However, whenever I try to script a dashed line (that is not the default setting of 12pt/ 0pt), it just won't work (or kinda work).

What it does, even though I change the settings (to 2pt/2pt), is that it only picks up the first information (making it 2pt/0pt), making the dashed line appear full, since there is no space in between the dashes. 

 

Does anyone know how i could make this work? Or maybe just change the default dashed lines settings so that i don't have to change them when recording the script?

This topic has been closed for replies.

3 replies

Community Expert
November 15, 2024

You can save your dashed line as a Graphic Style - and so therefore crate the action to make the offset path and then apply the correct dashed line graphic style. I've attached a picture as an example.

 

Kurt Gold
Community Expert
Community Expert
November 14, 2024

How about providing your action set file (.aia) as well as a sample Illustrator document with some further instructions?

CarlosCanto
Community Expert
Community Expert
November 14, 2024

it seems you're trying to record an Action, is that right? not writing a script in Javascript?

Participant
November 14, 2024

Yes that's right!