Illustrator scripting is very very very limited, you can't script half its features...I don't have CS6 to test, but if you can accomplish that via Actions, that might be an option...since it's been reported CS6 can play Actions.
it's also been reported that CS6 can run menu commands, so there's your options...not much help with tools I guess.
oh, the other thing it may help is you can apply graphic styles...but that's as far as you can go with it, you have to create them by hand.
Ok. So I have created a new account as I can't acces the last one.
Illustrator scripting is limited. But the real limitation of it is the available documentation.
Actions are a little to basic to accomplish this task. But when you say cs6 can play actions I get confused. I think you mean running scripts from an action.
This has been possible in all iterations of CS. Only they are not persistent on restart. Same deal I think with menu commands.
My thought is the actions panel loads on program start before the scripts get loaded in the menus. But that's off topic.
I can't see how to do this with graphic styles.
I will put together a better explanation of what I am trying to achieve in the hopes that it can be done, and that it's my poor description getting in the way.
Thanks for the quick response.
...about running menu commands, no can do before CS6, but for your request it wouldn't help I guess.
...graphic styles, I just tested it and it works, meaning you create your Width profile, save it as a graphic style (both manually), then you can apply it to any path via scripting.
Ok, That makes sense. I did read that you can now run actions from a script, somewhere...
As for the graphic styles, its the profile I wish to make each time.
I'll see if I can make this make sense...
If I start by drawing a line. Select it then run my script...
From here the script would take over, Drawing a line from Most Left end, and the height of the object. Then extend line to meet, and join.
So far I can see all of the above can be done (this is just an example)
Here I have used the Variable Width tool to widen to top of the red Line to the first anchor. Then move down a set amount and widen to intersection of black line. Repeat untill no more line.
This is sketchy as I did it by hand and too quickly, and it's as far as i can go on this PC as I only have CS5 here.
But in essence that is what I'm trying to achieve.
Hope that makes it a bit clearer.
that's what I'm trying to explain...it seems it is not possible to do the width profile via scripting, you'll have to do it by hand, then when you're happy with the results, drag your whole object to the Graphic Styles Palette, give it a name and only then, you'll be able to apply this very same graphic style to other paths, let say other plain lines, via scripting.
...by the way, try to access your original account...that user name is much better
I lost the password, Prob like the Name. And I think I used an old email as I get no Email when I ask to reset it.
I was odviously not in a good mood with adobe when I came up with that one...
What you describe with graphic styles is like making a brush.
I wonder if I could use an onMouseDown Event to trigger the tool.
I hope I don't have to resort to AHK
sorry to be the bearer of bad news...there's no access to events either
oh, that's another story, yeah you might be able to do it with that.
I'd like to note here that there is access to events if one builds the extension panel with CS Extension Builder though. But Ilustrator events, not mouse clicks.
SelectionChanged is the particularly useful one.