Guest
2012-07-04, 02:16 AM
Finally, to attach the script action to all shapes in the canvas which you are editing, so that any one of them will highlight the ancestral path in response to a click from the Browse tool, you could run something like this:
Code:
property pScript : "
set selection of front window to getpath(self, true, true)
on getpath(oShape, blnNodes, blnLinks)
tell application id \"OGfl\"
set lstIncoming to incoming lines of oShape
if lstIncoming ≠ {} then
set oLink to first item of lstIncoming
set lstPath to my getpath(source of oLink, blnNodes, blnLinks)
if blnLinks then set lstPath to lstPath & {oLink}
if blnNodes then set lstPath to lstPath & {oShape}
else
if blnNodes then
set lstPath to {oShape}
else
set lstPath to {}
end if
end if
return lstPath
end tell
end getpath"
tell application id "OGfl"
repeat with oShape in shapes of canvas of front window
set script of oShape to pScript
end repeat
end tell
Last edited by RobTrew; 2012-07-04 at 02:27 AM..