I have three layers in current the first canvas. Each layer has a shape. I set an action of layer2’s shape.
tell application "OmniGraffle"
tell canvas of front window
set lstLayers to (layers of it) as list
repeat with oLayer in lstLayers
set locked of oLayer to true
set visible of oLayer to false
if oLayer = current layer then set visible of oLayer to true
if oLayer = layer named "layer1" then set visible of oLayer to true
-- possibly invisible too
-- set visible of oLayer to false
end repeat
-- set visible of layer to false
end tell
end tell
I want to implement the layer1 and current layer show and the other layers hide ( In the future I may add layer 4 layer5).
How to fix my code bug?