--Copyright 2009, Sunny Fugate
--Creative Commons Attribution-Share Alike 3.0
--http://creativecommons.org/licenses/by-sa/3.0/us/
--

--Expect values to be comma delimited x,y with linebreak between each value
set theData to the clipboard
set AppleScript's text item delimiters to (ASCII character 13)
set valueList to every text item of theData
--set numberString to "{"
set numberList to {}

set AppleScript's text item delimiters to {","}
repeat with value in text items of valueList
	--stupid extra repeat which never repeats to emulate a repeat 'next/continue'
	repeat while true
		try
			set x to item 1 of text items of value as number
			set y to item 2 of text items of value as number
			
		on error theError number errorNum
			exit repeat
		end try
		set numberList to numberList & {{x, y}}
		exit repeat
		
	end repeat
end repeat

tell application "OmniGraffle Professional 5"
	tell canvas of front window
		make new line at end of graphics with properties {point list:numberList}
	end tell
end tell
 
software/applescript/omnigraffle_draw_line_from_points_on_clipboard.txt · Last modified: 2009.08.21 00:25 by sunny
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki