Applescript and groups
I wish to traverse each group in my OG document. I have the following code:
[CODE] tell application "OmniGraffle Professional 5" set myGraphics to graphics of (canvas of front window) repeat with g in myGraphics set myGroup to group of g if (myGroup is not missing value) then repeat with g1 in graphics of myGroup -- do some stuff end repeat end if end repeat end tell [/CODE] I get the result that "myGroup" is not defined; I thought the whole point of testing for missing value is to check for defined? (ie/ null check). The if statement doesn't work the other way either (ie, check for missing value).. what am I doing wrong? |
Yeah, that doesn't quite do what you want. Here's an example that works better:
[code] tell application "OmniGraffle Professional 5" set allGroups to every graphic of (canvas of front window) whose class is group repeat with _group in allGroups repeat with _graphic in graphics of _group set draws shadow of _graphic to false -- turn off shadow for grouped objects end repeat end repeat end tell [/code] Some of these things are challenging to figure out without using something like the Explorer in Script Debugger... |
Thanks. Script Debugger is very helpful, now to convince the powers to be to spend money on it!
|
All times are GMT -8. The time now is 08:08 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.