Skip to main content
pixxxelschubser
Community Expert
Community Expert
May 20, 2014
Answered

[JS] dashed stroke - alignment ?

  • May 20, 2014
  • 5 replies
  • 1061 views

Hello forum,

who knows, which command is needed to align a dashed stroke like this with JS - AI CS4+ 

(not the command for creating a dashed stroke and also not the way with graphic style and app.doScript and also not shpage AdjustDashes)


grateful for any help

pixxxelschubser

This topic has been closed for replies.
Correct answer Larry G. Schneider

I think that's one of the many things not accessible to scripting in Illustrator. You might get something by playing around with strokeDashOffset but no guarantees.

5 replies

m1b
Community Expert
Community Expert
January 23, 2022

I was working on the problem or reading this property (I don't need to write it, so my job is easier). I've written an ExtendScript function that takes a pathItem as input and returns true is the stroke dashes are aligned. See this question.

 

Also, just pondering a bit... it might be conceivable (assuming you're okay with the hacky mischief I used in my function) that you could instantiate a model pathItem from a file or library asset that *already had the property turned on*, and then modify from the inside-out, to match your actual target object exactly (one that doesn't have the dashes aligning). This would only work if the target path item didn't use anything else that the API can't access. Just a crazy idea.

- Mark

CarlosCanto
Community Expert
Community Expert
May 21, 2014

agree, I don't think we have such command...one more thing, Align Dashes debuted in CS5.

pixxxelschubser
Community Expert
Community Expert
May 23, 2014

I have suspected it, it's a shame.

@Larry,

there is no way (easy to work with different widths and heights).

CarlosCanto,

I wanted to mark your post as helpful, but I do not find the button.

CarlosCanto
Community Expert
Community Expert
May 23, 2014

thanks pixxxel, no problem, I think the helpful button is a casualty of the last jive "upgrade"

Larry G. Schneider
Community Expert
Larry G. SchneiderCommunity ExpertCorrect answer
Community Expert
May 20, 2014

I think that's one of the many things not accessible to scripting in Illustrator. You might get something by playing around with strokeDashOffset but no guarantees.