Search Action from an Object (via Apple Script)

When I click on an object (A), I want to search for another object with a specific name, so I put " Run Apple Script" in the Action section for (A).

tell front window of application "OmniGraffle"
	activate
	tell canvas of front window
		delay 0.5
		
		tell application "System Events" to keystroke "f" using {command down}
		delay 0.5
		tell application "System Events" to keystroke "SEARCH WORD" & return
	end tell
end tell

However, I get a System Event error and it does not execute.
If I run this script from the Script Editor application, it works fine.

Is this not possible as an object action within OmmniGraffle?