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 Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Applescript and groups Thread Tools Search this Thread Display Modes
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
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
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!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeating groups Gwydion OmniFocus 1 for Mac 2 2008-08-31 02:45 AM
1 resource, many groups arcticflea OmniPlan General 1 2008-04-24 09:35 AM
Sub Layers and Groups? abilstein OmniGraffle General 0 2007-12-03 07:25 AM
Hiding groups Nat OmniPlan General 2 2006-08-01 09:52 PM


All times are GMT -8. The time now is 03:58 PM.


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