I like this question.
I have been playing a little with it and it has me stumped.
a statement such as:
works fine and displays the origin, this also works with length and Angle.
But when you try to set these values it does not work.
it says nothing about it being read only.
Does anyone have any light to shed on this???
Hi, thanks for your response! What I don't get is why .resize doesn't work when .rotate does!
I came up with a workaround though - I was thinking I would have a path with the gradient the way I want it, then use a script to copy it behind the other shapes, one by one, and use the top shape in each group as a clipping mask, if you follow what I mean.
Maybe one should report the problems as a bug btw!
I Was thinking about that. But it makes the art a lot more complex. Especially if you want stroked shapes.
it should be simple.
I am happy to report a bug. But need to make sure it is a bug and not just something I'm not doing correctly.
Not it that it makes a lick of difference. If they paid any attention at all we would be able to run scripts from actions. Without having it break on restart!
I just reported it as a bug - it probably doesn't hurt if you do it too. I didn't bother creating a test case - the read-onliness of those properties has been widely documented in the forums...
I added a bug report on this, if these options are read-only, then the least they could do is say so.
sadly the scripting documentation is far from extensive.
// transform gradients findings // select a path item with a gradient applied to it before running the script var idoc = app.activeDocument; var ipath = idoc.selection; var fillcolor = ipath.fillColor; ipath.filled = false; // remove previous gradient transformations, to be able to apply new ones ?? ipath.fillColor = fillcolor; // re apply the same gradient color, without transformations. ipath.fillOverprint = ipath.fillOverprint; // without this, the gradient won't move or scale, but it does rotate ?? var moveMatrix = app.getTranslationMatrix(50, 0); var scale_moveMatrix = app.concatenateScaleMatrix (moveMatrix, 75, 50); var move_scale_rotateMatrix = app.concatenateRotationMatrix (scale_moveMatrix, 15); ipath.transform(move_scale_rotateMatrix,false,false,true,false,0, Transformation.CENTER);
Thanks, I'll give it a shot and see if it works!
This is great, how ever did you decide to try ipath.fillOverprint = ipath.fillOverprint;
I found the script can edit the object again, if you change angle say to 25° and re-run then it re-fills and transforms to the 25°.
What I can't work out is how to read the newly set angle etc...
is there a way you know of to get the values of the matrix.
using overprint wasn't my idea, it was on the link I posted, I wouldn't have thought of it either.
you might be able to work out the math in matrix values, all I know about it (not much), I got from here
in your link he uses ipath.fillOverprint = false;
not ipath.fillOverprint = ipath.fillOverprint;
but I tried setting it to false in your script and it still works.
Matrices look like quite a headache, could be that I've had a long day and my brain is a little soft right now.
I'll have to have a read at some point as they could be quite useful.
I tried to keep the original overprint setting whether true of false...I don't remember if it worked, I tried sooo many things that day, I got frustrated, nothing seemed to work.
ahhh the "joys" of coding...!
I tried Carlos snippet, which i modified for the case I had - and it worked fine - thanks!
hahaha, right, the joys of coding...Illustrator
great!!, glad to help