How can I toggle the "Ignore Color" button with a script?
- October 25, 2023
- 4 replies
- 3692 views
Hello there!
I'm still quite new to both scripting and Adobe Illustrator, but I would like to optimize my time by writing a script that can take full black and white images and remove the white.
My Frankenstein code starts by opening a test folder (I removed the location from the image Debug1, but I know where it points to) and grabbing an array of all files.
Then it converts these images to svg by the end of the function. In the midst of this transition, it places the image on a new document, traces it using a preset I call "Ignore White", and then redraws the image with the new paths (or at least that's how I think it works).
Anyway, my main problem is that when I call "options.loadFromPreset(tracingPresets[19])" (image in Debug2, line 67), the alert shows that my preset does load and that it has the correct name, but when I run the script, I can clearly see in Debug3 that the Image Trace settings did not update properly to "Ignore Color" (aka Ignore White), AND the preset is called "Custom" and not "Ignore White".
Does anyone know how I can toggle the "Ignore Color" button in real time so that my SVG will actually remove the white and be fully transparent?
P.S. (I already use "options.ignoreWhite = true;" on line 71, and that definitely doesn't work NOR does it show in Debug3 when the script is paused due to the alert on line 74)
Any and all help would be greatly appreciated!
