If you copy a line in OmniGraffle (with Cmd C), you will find that you can not paste it into OmniGraphSketcher.
If, however, you select a line in OmniGraffle, and copy it by running this script, you will find that you can then paste it's set of points into OmniGraphSketcher for quick decoration and axis-framing.
(Places line in clipboard as a sequence of point coordinates - could also be pasted into something like Excel)
--
If, however, you select a line in OmniGraffle, and copy it by running this script, you will find that you can then paste it's set of points into OmniGraphSketcher for quick decoration and axis-framing.
(Places line in clipboard as a sequence of point coordinates - could also be pasted into something like Excel)
Code:
-- Ver .03 (Slightly faster) -- Copy coordinates of selected OmniGraffle line into Clipboard -- (In form that can be pasted into OmniGraphSketcher, Excel, etc) on run tell application id "OGfl" tell front window set lstSeln to selection set blnFound to false repeat with oSeln in lstSeln if class of oSeln is line then set blnFound to true exit repeat end if end repeat end tell if blnFound then set lstData to points of oSeln set {{rxMin, rxMax}, {ryMin, ryMax}} to my GetRanges(lstData) set {rOriginX, rOriginY} to {rxMin + ((rxMax - rxMin) / 2), ryMin + ((ryMax - ryMin) / 2)} else return end if set strClip to "" set {dlm, my text item delimiters} to {my text item delimiters, tab} repeat with i from 1 to length of lstData set {rX, rY} to item i of lstData set item i of lstData to ({(rX - rOriginX), -(rY - rOriginY)} as string) end repeat set my text item delimiters to return set the clipboard to (lstData as string) set my text item delimiters to dlm end tell end run on GetRanges(lstData) set rHigh to 2 ^ 16 set {rxMin, rxMax, ryMin, ryMax} to {rHigh, 0, rHigh, 0} repeat with oPoint in lstData set {rX, rY} to oPoint if rX < rxMin then set rxMin to rX if rX > rxMax then set rxMax to rX if rY < ryMin then set ryMin to rY if rY > ryMax then set ryMax to rY end repeat {{rxMin, rxMax}, {ryMin, ryMax}} end GetRanges
Last edited by RobTrew; 2011-11-14 at 11:53 AM.. Reason: Typo in title :-)