Mobile app version of vmapp.org
Login or Join
Margaret771

: Strange macro behavior in Illustrator CC I have developed a macro in Illustrator CC (Version 21). Starting from a document of a given size, it deforms it and pastes several copies into another.

@Margaret771

Posted in: #AdobeIllustrator #Automation

I have developed a macro in Illustrator CC (Version 21). Starting from a document of a given size, it deforms it and pastes several copies into another. The macro has 27 Actions in total.

This works fine except for one thing: starting from the same template but adding different artwork that fits a fixed predefined zone, the final outputs are shifted from one case to the next or one execution to the next.

I can't see any difference in the sizes of the elements that I am processing and whenever pasting, I am using Paste in Place operations.

Any idea what could explain such discrepancies ?





Update:

I have identified where the sequence goes wrong:


Create a rectangle that covers the whole document,
Select everything,
Make a clipping mask (the rectangle at step 1),
Scale non-uniformly, i.e. 86% on X and 100% on Y.


This is where the problem appears: the centering of the stretched document seems to move unpredictably. I suspect that the mouse position at some moment (before launching the macro) can have an influence.

Update 2:

After deeper observation, I notice that the first time you open a document and process it, the centering is wrong; then if you reopen a second times and more, the centering becomes correct. And then if you open another, the same phenomenon repeats.

/version 3
/name [ 11
57617270696e6720386f7a
]
/isOpen 1
/actionCount 1
/action-2 {
/name [ 14
5761727020746f204d6173746572
]
/keyIndex 0
/colorIndex 0
/isOpen 1
/eventCount 4
/event-1 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_rectTool)
/localizedName [ 14
52656374616e676c6520546f6f6c
]
/isOpen 0
/isOn 1
/hasDialog 1
/showDialog 0
/parameterCount 6
/parameter-1 {
/key 1953460076
/showInPalette -1
/type (integer)
/value 15
}
/parameter-2 {
/key 2003072104
/showInPalette -1
/type (unit real)
/value 670.9606299213
/unit 592476268
}
/parameter-3 {
/key 1751607412
/showInPalette -1
/type (unit real)
/value 290.8346456693
/unit 592476268
}
/parameter-4 {
/key 1668182644
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-5 {
/key 1668183128
/showInPalette -1
/type (unit real)
/value 335.48
/unit 592476268
}
/parameter-6 {
/key 1668183129
/showInPalette -1
/type (unit real)
/value -145.415
/unit 592476268
}
}
/event-2 {
/useRulersIn1stQuadrant 0
/internalName (adobe_selectAll)
/localizedName [ 10
53656c65637420416c6c
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 0
}
/event-3 {
/useRulersIn1stQuadrant 0
/internalName (adobe_makeMask)
/localizedName [ 18
4d616b6520436c697070696e67204d61736b
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 0
}
/event-4 {
/useRulersIn1stQuadrant 0
/internalName (adobe_scale)
/localizedName [ 5
5363616c65
]
/isOpen 0
/isOn 1
/hasDialog 1
/showDialog 0
/parameterCount 7
/parameter-1 {
/key 1970169453
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-2 {
/key 1818848869
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-3 {
/key 1752136302
/showInPalette -1
/type (unit real)
/value 85.3033530481
/unit 592474723
}
/parameter-4 {
/key 1987339116
/showInPalette -1
/type (unit real)
/value 100.0
/unit 592474723
}
/parameter-5 {
/key 1668247673
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-6 {
/key 1684370520
/showInPalette -1
/type (unit real)
/value 0.
/unit 592476268
}
/parameter-7 {
/key 1684370521
/showInPalette -1
/type (unit real)
/value 0.
/unit 592476268
}
}
}

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret771

2 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes874

I think I have solved the issue.

By reconstructing the macro and comparing to the old code, I noticed that the last two parameters DX and DY do not appear.

These must have been remnants of the macros created under an older version of Illustrator. And even they were set to 0., their presence had a bad influence.

I have removed them from the old code, and it seems that the instability has disappeared.

10% popularity Vote Up Vote Down


 

@Caterina889

The only thing I could guess at is the scale origin. If it's not centered, then it's feasible that things may shift to the left slightly after the scaling.

As my comment states, this kind needs to explain the exact procedures in each step. You have a few move actions... which beg the questions.. move how? What distance? from what origin?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme