So I inherited a quite complex set of macros to automate some artwork generation. I can't seem to find where some illustrator artwork rotation is happening. Stepping through the macro, some Javascript is called which sends some scripting to Illustrator which in turn rotates some artwork on named layers.
In the javascript there are 4 lines of code with "rotate", in different spots with conditional statements. That is all great but when I comment out those 4 lines to try to "break" the rotation, the artwork still rotates. I've checked for some illustrator actions and nothing of the sort nor are any actions being called to perform.
Ya possibly. It is crazy though. I can change the name of that function to try to break the link to it and the artwork still rotates. It is like MacOS is sometimes linking to another file somewhere. Is there a known issue with MacOS not reading the correct file? I've search and destroyed any other copy of the function repository. I get the feeling that there is something I am missing but this function is the only one that is being called from a macro.
More likely there's something else going on, like KM telling AI to run a script which runs a script in a static file Whoop-de-doop.js -- and the rotate command is in there.
If there's a chain of 117 macros, add a KM "Display Dialog" action at the end of every 20th macro to display the numbers 1 thru 6. You can then watch for the rotation and dialog -- if rotation happens after "4" but before "5" you'll know it is somewhere in actions 81-100. Rinse and repeat until you've nailed it down to a single macro at post that.
I don't think that is necessary. I can watch illustrator while the macros are running and step through one by one and see when it rotates. It is frustrating to know exactly which function is running right before the rotate, then try to effect some change, like setting the rotation angle to 90 instead of 45, and nothing happens to that effect in Illustrator. It is like the function is being cached or stored in memory instead of reading the script each time? Is that possible? and if it is how do I kill any behavior like that?
There's a number of ways to run scripts in Illustrator from KM. If you send it "direct", eg with a KM "Execute AppleScript" action and tell application "Adobe Illustrator" to do javascript "some_javascript()" then it should do what you send. If, instead, you use a KM action to write some JavaScript to a file then tell AI to execute that file you could have problems if there are asynchronous calls or similar.
The problem is far more likely to be either in the logic of the macro or some funky Illustrator side-effect than in KM's behaviour.
So the JavaScript that Illustrator is running is in a file? Then it is either an Illustrator, file system, or user error issue -- it almost sounds as though the file you are editing isn't the file Illustrator is running.
I am calling a function in that file. I literally can change the function name in that file and the macro will still run.. the artwork will still rotate. Now there is another file that holds product data and rotation angle data. I can change the rotation angle in that file and eventually it will take into illustrator. Normal rotation is 45, and I will just tell it 90 so I can see the effect.
I'm thinking a file system problem, what kind of file system issues can come up?