View Single Post
Quote:
Originally Posted by whpalmer4 View Post
set notes to last item of labeltext -- must be a better way, but what is it?

[/code]
I'm not sure if this is better but I've ended up with a key value filename being filled with the value of text.

Code:
(* Script that is designed to process the graphics that result from a finder item being dropped on the
OG icon.  The script adds two data fields FileName and URL to each graphic and then populates them.  

It also deletes all the lines leaving just the icons.  If you want the lines just comment out the delete below

Most of the script was written by whpalmer4, I just fiddled a little.

Simon Knight Jan 2012

*)



tell application "OmniGraffle Professional 5"
	tell canvas of front window
		set myGraphics to every graphic
		repeat with myGraphic in myGraphics
			tell myGraphic
				if class is shape then
					
					--set myProps to properties  -- useful if uncommented to examine the prop list in script debugger
					
					set tFileName to text of myGraphic
					set tURL to url of myGraphic
					
					make new user data item with properties {name:"FileName", value:tFileName}
					make new user data item with properties {name:"URL", value:tURL}
				else if class of myGraphic is line then
					delete myGraphic
				end if
			end tell
		end repeat
	end tell
end tell
best wishes
Simon

Last edited by Simon Knight; 2012-01-14 at 12:35 PM..