The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Scripting to toggle a particular layer/canvas for ALL canvasses Thread Tools Search this Thread Display Modes
I'm adding indexing to my stack of canvasses via including an 'index' layer for each canvas that contains a dot+index_item that's positioned within the proximity of the target (base layer).

Example: entering '•object' in the find dialog would immediately jump to where '•object' is positioned (within the index layer above the target (base layer).

This only works with the index layer is VISIBLE.
... so I made the index item transparent within the VISIBLE index layer.

This works...
... but it also interferes with the action events of the base layer. I have to click outside the hidden index item to get the target base-layer item to fire its event.

Possible Solution:
1) Toggle the visibility of the index layer when ever a FIND is requested. -- All I need to do is to locate the target via SHOW the index layer then HIDE the Index layer one the target is reached.

IS THIS POSSIBLE via the available apple script engine?

Any references on how this can be done?


Last edited by Ric; 2010-03-24 at 11:18 AM.. Reason: Wanted to finish adding tags (can't) & Modify Thread subscription.
I use this to turn off and on wireframe annotations. I attach the script to a button on the first page. Change the layer name "Annotation" to your "index" layer.

tell application "OmniGraffle Professional 5"
set theDocument to front document
set allCanvases to canvases of theDocument
repeat with canvasCount from 1 to (length of allCanvases)
set nextCanvas to item canvasCount of allCanvases
set nextCanvasLayers to layers of nextCanvas
repeat with layercount from 1 to (length of nextCanvasLayers)
set nextLayer to item layercount of nextCanvasLayers
if (name of nextLayer is "Annotation") then
set currentVisibility to visible of nextLayer
set currentPrintability to prints of nextLayer
set visible of nextLayer to not currentVisibility
set prints of nextLayer to not currentPrintability
end if
end repeat
end repeat
end tell
I haven't looked at AppleScript for nearly 20 years. Now I see the use of it. I'll toy with it.

Thanks for the details!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting objects on shared layer and normal layer noirdesir OmniGraffle General 7 2013-02-06 08:57 AM
Change an existing layer into a shared layer Jor_is OmniGraffle General 8 2012-03-19 10:10 PM
Moving items from layer to layer KlassicJazz OmniGraffle General 1 2011-02-06 12:01 PM
Can't export canvasses into other formats nestorph OmniGraffle General 1 2011-02-01 06:51 PM
Change an existing layer into a shared layer Jor_is OmniGraffle General 0 2008-02-25 12:19 PM

All times are GMT -8. The time now is 12:48 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.