Scripting to toggle a particular layer/canvas for ALL canvasses
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? Thanks, Ric. |
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 |
Using AppleScript...
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!! Ric. |
All times are GMT -8. The time now is 06:23 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.