View Single Post
The sitemap.xml format is particularly simple. Here is a quick AppleScript that will create a box in Graffle for each URL in a <loc> tag. They aren't connected to each other or anything - that would be a bit more complicated - but I'd be happy to extend the script once you left me know what sort of structure you are interested in. (Just change the first property line to the Mac-style path of the sitemap file.)

Code:
property file_to_read : "Tiger:Users:toon:Documents:sitemap.xml"

tell application "OmniGraffle"
	set fileID to open for access file file_to_read
	set isDone to false
	set startingY to 20.0
	repeat until isDone
		try
			-- read up to a tag, and see what the tag is
			read fileID before "<"
			set theTag to read fileID before ">"
			
			-- if it is a <loc> tag, then read the contents
			if theTag is "loc" then
				set theURL to read fileID before "<"
				
				-- and make a box in Graffle with the URL as its title and also its link
				tell canvas of front window
					make new shape at end of graphics with properties {text:{alignment:left, text:theURL}, url:theURL, vertical padding:5, autosizing:full, side padding:10, origin:{100.0, startingY}}
				end tell
				set startingY to startingY + 30.0
			end if
		on error
			set isDone to true
		end try
	end repeat
	
	close access fileID
end tell