G’day.
We need to ‘flash’ layers on and off to check that certain alterations have not lost details. I’m trying to also do it in selection mode.
Trouble is, the actions are adding stroke widths to the images each time the script is run.
I’m new to illustrator scripting, and can’t work out how to turn of the default stroke width to see if it makes a difference.
Can anyone help please, or perhaps suggest a better way of doing this?
Regards
Santa
if name of theObject = "Graphics 4" and not LayerReDraw then
set LayerReDraw to true
tell application "Adobe Illustrator"
activate
tell document 1
set visible of layer "Our Layer" to true
set visible of layer 1 to true
end tell
set spotColorCount to count of spots in document 1
if exists spot "Big Blue" in document 1 then delete spot "Big Blue" in document 1
if exists spot "Big Red" in document 1 then delete spot "Big Red" in document 1
if exists spot "Big Black" in document 1 then delete spot "Big Black" in document 1
set newSpot1 to make new spot in document 1 with properties ¬
{name:"Big Blue", color:{red:0.0, green:0.0, blue:255.0}}
set newSpot2 to make new spot in document 1 with properties ¬
{name:"Big Red", color:{red:255.0, green:0.0, blue:0.0}}
set newSpot3 to make new spot in document 1 with properties ¬
{name:"Big Black", color:{red:0.0, green:0.0, blue:0.0}}
set default stroke color of document 1 to {spot:newSpot2, tint:100.0}
tell document 1
set color of last layer to {red:255, green:0, blue:0}
set color of layer "Our Layer" to {red:0, green:255, blue:0}
repeat 5 times
delay 0.1
set visible of layer "Our Layer" to false
delay 0.1
tell application "System Events" to tell process "Adobe Illustrator"
keystroke "a" using {command down}
end tell
set default stroke color to {spot:newSpot1, tint:100.0}
set visible of layer "Our Layer" to true
delay 0.1
set visible of last layer to false
delay 0.1
tell application "System Events" to tell process "Adobe Illustrator"
keystroke "a" using {command down}
end tell
set default stroke color to {spot:newSpot2, tint:10.0}
set visible of last layer to true
end repeat
set visible of last layer to false
tell application "System Events" to tell process "Adobe Illustrator"
keystroke "a" using {command down}
end tell
set default stroke color to {spot:newSpot3, tint:100.0}
set visible of last layer to true
my SetLayerColor()
set default stroke color to {spot:newSpot3, tint:100.0}
end tell
end tell
if (integer value of button "Graphics 4" of window 1) = 1 then call method "performClick:" of object (button "Graphics 4" of window 1)
if (integer value of button "Graphics 5" of window 1) = 1 then call method "performClick:" of object (button "Graphics 5" of window 1)
set LayerReDraw to false
end if