My old desktop (running 2017 version) had a working VBA macro that I created to isolate all text base items and stretch them 16x wide (height remained the same) and set them to center alignment. This would not affect curves.
The hard drive died and I've been trying to recreate this functionality on 2019 using the javascript however it's been difficult.
Here's the Script that I've been working on:
var i;var data = "Test";for (i = 1; i < 3; i++) {
host.ActiveDocument.AddToSelection(host.ActiveLayer.Shapes.Item(i));
if (typeof host.ActiveSelection.type == "number") {data = typeof host.ActiveSelectionlet s1 = host.ActiveLayer.CreateArtisticText(10.515937007874, 6.44105118110236, data);
host.ActiveSelection.Stretch(16,1);
}
host.ActiveDocument.ClearSelection();}
The stretching seems to be working and the for loop is going through objects (wish I could isolate this to just text). I don't know how to center justify them either.Any help would be appreciated.Thank you,
Jayson
I am sure some of those geniuses here will jump in to help. It's amazing what they can do with code to make life easier! ; )