Having trouble getting OmniGraffle "selection" in AppleScript

I am trying to update an old script to set alternating row colours on a table but am hitting a wall with “selection”.

I am using OmniGraffle 7.3 test (v177.2 r281886) and the script is from 2008 or so named “Create Alternating Row Colors.scpt” (author unknown). I have cut the script to this minimum but get this error message. “OmniGraffle got an error: AppleEvent handler failed.”

tell application "OmniGraffle"
	tell front window
		if selection is {} then
			display dialog "Please select a table with at least two rows. The first cell of the each of the first two rows will become your alternating row colors." buttons ["OK"] default button 1
		end if
	end tell
end tell

Even just adding “get selection” right after the “tell front window” line produces an error.

I am running Mac OS X El Capitan version 10.11.6 (15G1212)

Thanks in advance!


I have been having the same issue since the 7.3 (v177.3 r283059) update. I reduced the script even further, and anything involving “selection” is enough to throw: error “OmniGraffle got an error: AppleEvent handler failed.” number -10000
I tested the code on an old version of OmniGraffle (6.6.2), and it works.

tell front window of application “OmniGraffle”
set objects to selection
end tell

Reading the selection is certainly broken (for AppleScript and JavaScript for Automation) in the present build of OG Test (7.3).


are all down at the moment – probably important to flag this to support if you haven’t done that yet.

Now fixed and working well here in: 7.3.1 test (v177.5 r285572) :-)

Yes, nice!