UPDATE: This software is now Open Source and hosted on Github. You can download it here.
A few months ago we were tasked with a redesign of a pretty large site and we had to get a grasp on what was out there quickly. We saw they had a sitemap.xml file, and it kicked off our innate laziness: someone on the internets must have made something to suck this XML into Omnigraffle, right? In fact, several someones had wrangled with this quite a bit, but there wasn’t a nice and easy solution out there. Just lots of hair-pulling.
I had a lot of the same types of problems getting this script to work, so it was time to roll up the sleeves and spit out something better! Hair or no hair to be pulled! Let me introduce you to the Fuzzy Math Sitemap.xml to Omnigraffle Sitemap Generator. It’s super-simple to use:
Ker-bang! You should have an awesome Omnigraffle sitemap. Here’s a picture of what you’ll see happening along the way:
Popularity: 60% [?]
Tags: applescript, omnigraffle, sitemap
THANKS. Awesome time saver.
[...] Omnigraffle Sitemap Generator is a script that auto creates nicely looking sitemaps from a given XML file. It’s really just [...]
I always used to do my sitemaps with smart graphics of word, but with the generator its better ;)
Hi Jakub and Meyrab-
Thanks for the link and the words of praise! Feedback on how it works or thoughts for new scripts are always appreciated.
Best,
Jk
[...] generowanie mapy serwisu to zwykle dosc pracochlonne zajecie. Jason Kunesh, stworzyl skrypt, ktory z istniejacego (zazwyczaj do Google) pliku sitemap.xml, tworzy jednym kliknieciem sensowne [...]
You guys are pure genius. This literally just saved my hours of tedious work. Thank you very much for posting this incredibly useful tool. Simply amazing.
Awesome, Shane. Great to hear it helped out.
great work!
one question, ¿is possible that the script works inversely, generating XML from an OmniGraffle?
thanks,
Basilio
Hi Basilio-
You many want to talk to the Omnigraffle support ninjas themselves. All Omnigraffle files are somehow really XML, so there may be a way.
It’s just probably beyond me!
This really could be a time saver for me, but unfortunately – if I run the program and direct it to my sitemap.xml … i can’t pick the file to generate the diagram :(
But thank you anyway!! katharina
Hi Katharina-
I’m not sure I understand the problem? It sounds like you get the file dialog box, but you can’t pick the sitemap.xml file? Let me know as I’d be up for helping you out with it.
Thanks!
Jason
hi Jason,
exactly. I’m running the script, the dialog box shows up and I can’t pick the file.
Thank you so much :)
Hmm. It may be the file, as it may not be recognizing it.
Can you regenerate the sitemap.xml using a tool like this and try again? Alternately, make sure you have the file extension ‘.xml’ on the end of the file.
Best!
Jk
The same thing is happening to me. I tried saving the sitemap file to my desktop from Chrome, Firefox and using curl (trying to ensure it is really a plain text file). In all cases the file is called sitemap.xml and is not selectable from the Choose a File dialog. This is on Mac OS 10.5.8.
Bummer. Sounds like a cool tool.
Hi Anthony-
Weird, and your steps all seem really complete. In the script I use:
set sitemapFile to choose file with prompt “Please select a sitemap.xml file.” of type {“XML”}
To do the file upload. Can you tell me about the file type (Do a Command-I to get info) so I can identify any changes we’ll need to make?
Thanks, and sorry for the confusion.
Best,
Jk
I don’t see anything that says file type. Here is a screen shot of the Get Info window. You can see I even tried associating the file with the script application.
Hi Anthony-
That is most bizarre. Is your file well-formed XML? Does it render when dragged into a browser?
As you can see in my screenshot, it appears as an XML document of type: text, but yours does not. I hate to sound stupid, but I am not sure how the Mac is doing this. When I have time I will remove the upload requirement that checks if the file is of type ‘XML’ or, if you get a fix that converts or sets up your file correctly, please let me know.
Since this img upload thing is going batty, here’s the image URL as well: http://blog.fuzzymath.com/files/2010/09/sitemap-xml-error-file-type.png.
I have also been unable to make the application recognise my sitemap.xml file. I have read all of the comments and even checked on a PC that my sitemap file is recognised as XML.
Do people who have been able to get it working have any insights to share with the rest of us? I’d dearly like to have this working and share it with my colleagues!!
Thanks in any case for the effort.
Hi Stephen-
Check out Billy’s comment below. I’ll also be re-releasing the code with that fix tomorrow so you should be all set.
Best,
Jk
Hi Jason,
Thanks for the update. I’ve read the rest of the comments below.
I understand you’ve released some updated code, but I’m a bit confused about what I need to do to make the script work.
Apologies if I’m being a bit slow… the original Generator file appears to be the same, and I’m not clear what the updated script you’ve supplied does or how to use it. I tried downloading it and got a blank ‘read me’ file.
Help!
Thanks, Steve
Hi Stephen-
My apologies for definitely being slow, since I didn’t complete the push of all the stuff into git. Now there’s a real README file and, more importantly, both a compiled and a script version of the Applescript application.
The only change I made was to stop doing the file-type checking since some XML files did not register with OS X as “truly” XML. Other than that, the script is unchanged. You should be able to drag any Google/search engine standard-formatted sitemap.xml file onto the SWAG to see some results.
Please do let me know if that’s not the case.
Thanks!
Works a treat! Thanks!
hey guys / gals..
wanted to just do a quick test to see how this worked.. and it proved to be a little more digging thru script settings and file extensions than I wanted to spend time on.. so..
quick fix.. remove the “of type {“XML”}” requirements from the code..
(Warning: will be messy if you select the wrong file!!!)
change this:
set sitemapFile to choose file with prompt “Please select a sitemap.xml file.”of type {“XML”}
to this:
set sitemapFile to choose file with prompt “Please select a sitemap.xml file.”
when I find the ‘clean’ fix for this.. I’ll drop back and post it.
until then.. be careful which file you select.. and it works fine!
did a test on the afore mentioned xml-sitemaps link.. with 150 pages.. and looks great.
good hunting!
Hi Billy-
That is absolutely right. I just made the same fix myself. I don’t know why those files aren’t recognized as XML by the ‘script, but they’re not. I’m going to do a re-issue with that included as well.
Thanks for the hard work on this, it works really well.
One change I have attempted to make myself is to pass through the full URL of the page from the sitemap so that when exported from OmniGraffle as a PDF it contains clickable links to the pages.
I’ve worked out that you are using the URL property of the shape to find the parent, this works for creating the layout but the PDF contains file references to the file on the local hard drive.
I’ve been toying around with the user data property of a shape in OmniGraffle Pro, you can store the URL data in that with the following snippet:
user data:{aURLkey:aURL}I’ve added it to your makeShape function. The only problem I have is how to search for it in your findShape function?
I’m trying to modify the following line:
set matchingShapes to shapes of canvas of front window whose url is shapeTextbut I can’t get my head around the syntax to make it find the shapeText value in the user data records.
Any thoughts?
Regards Alan
Hi Alan-
Ah yes! I had to write to Omnigraffle support to figure out the syntax for that since I couldn’t find it either. From a different script here’s a line I used to reference user data:
if user data item "PageID" of oShape exists then
set tempID to value of user data item "PageID" of oShape
end if
So yours would be something like:
set matchingShapes to shapes of canvas of front window whose url is value of user data item "aURLkey" of shapeText
I think?
Good luck, and let me know if it works, I’d love to add it to the script as well!
Hi Jason,
Thanks, I managed to get around it a different way as I couldn’t figure out the syntax. I will try with your suggestion also but I added a third stage to your script that loops through the shapes copying the aURLkey value into the URL.
tell application "OmniGraffle Professional 5"set matchingShapes to shapes of canvas of front window whose url is not null
repeat with currentShape in matchingShapes
set myUserData to the user data of currentShape
set the url of currentShape to myUserData's aURLkey
end repeat
end tell
I also made a change to the line calling makeShape:
set childNode to makeShape(cItem, cItem, currentURI)and changed makeShape so that it adds the full URL into the user data:
return make new shape with properties {text:aTitle, url:aURL, user data:{aURLkey:webAddr}...Regards Alan
Hi Jason,
This worked for me:
set matchingShapes to shapes of canvas of front window whose value of user data item "aURLkey" is shapeTextRegards Alan
[...] Fuzzy Math’s Omnigraffle Sitemap Generator. If you’ve got a sitemap.xml file for the site lying around somewhere, all you need to do is [...]
It is working for me too now. Thanks for the fix!
Jason,
One question, in your post you said you needed this for a “pretty large” site. Do you have a ball park figure about the number of pages you were dealing with?
Hi Anthony-
I was looking at a site with 483 distinct pages. Whew. I graphed it using the script, but it did take awhile!
I dropped an XML file into this tool and it’s not generating the sitemap as expected. Here’s what I’m doing: 1) Open Omnigraffle; 2) Run the app; 3) Select the XML file. Omnigraffle opens up a new page, but it’s empty.
Is there any particular formatting with the XML file itself that might stop it? I’m looking at your screen sample and the formatting is different from the XML I’m trying to use (not created by me). See http://imgur.com/Zqo8u.png
Any suggestions? Thanks!
Hi Darren-
Yup, I wrote the sitemap generator to work only (I hate to tell you) with the standard sitemap.xml format. I’ve posted the code to github: http://github.com/jdkunesh/Sitemap-Wayfinding-Applescript-Generator–SWAG–
So you may be able to download it and modify it to suit your needs?
Good luck!
Hi, Jason. That’s what I figured. Thanks for the response, though!
Hi everybody-
I’ve updated the sitemap.xml generator so you can get the source code here:
http://github.com/jdkunesh/Sitemap-Wayfinding-Applescript-Generator–SWAG–
It should be able to accept Google sitemap.xml files more easily now, no matter how Mac OS X recognizes them.
Good luck!
Jason, I got the applet to work by downloading version 7. Could I suggest that rather than having to dig through this thread and find the file on github (the download button at the top doesn’t jump out and finding the right file to download for non-developer might be tough) how about just linking directly to this new version 7 on your your page here?
Otherwise I now have a sitemap in Omnigraffle. Thanks very much for your hard work, this is going to save so much time.
Cheers.
Hi Richard-
That’s a great suggestion. I’ll go back and do those edits today.
Best!
Jk
[...] for the awesome amounts of interest in the sitemap generator. To make it easier for people to work with the generator, we’ve open sourced it under the GPL [...]
[...] Omnigraffle Sitemap Generator from Sitemap.xml [...]
A lot of this thread goes above my head. I have downloaded the app and created a .xml sitemap using xml-sitemaps.com – saved the file to my desktop called sitemap.xml and it loads in the browser fine. however if I double click (open) the file from finder, it launches Final Cut Pro – seems xml file is associated with that program somehow. Whatever the case, running your applet and then browsing for the xml file, it is greyed out in finder and cannot select it. Also, i have placed the applet on my desktop, but i cannot drag the xml file onto it, as the above instructions describe. I’m sure this applet is awesome but can’t quite get off the ground here. Thanks.
Ignore this, as mentioned above, I found version 7 and can now open the sitemap.xml file. Any ideas what caused this issue with certain xml files not being recognized by Mac OS?
THANKS A LOT GUYS! this is a life saver!
Hi.
Is there any software that can crawl any site and get all of the pages and its relations in graphical mode?
Or maybe some software that uses some format to visualize data like this?
My idea is to type site url and get the picture of all pages, its relations and some few info like how many times other pages linking to that page etc.
I thought to code this by myself but when I had just created the structure of DB I started thinking about code realisation and graphical visualization and my brain was exploded thousand times and I’m in despair :(
Hi Chrizt-
I am sure there are tools out there that take screenshots of a number of pages but I am unaware of ones that then build out a sitemap-like view of those pages.
You could start with the omnigraffle tool and then replace the boxes with a screenshot but that would be a lot of manual work.
Sorry I don’t have more help for you.
Mark
Fantastic- thanks for making my work a little faster!
Probably the most useful tool I’ve come across this year. Thanks!
Glad to hear it Bayo!
BEST. TOOL. EVER. (yes, I’m yelling. about 15 seconds away from a happy dance too). Thank you!!! This kicks ass.
Glad to help Kim!
Hi
Just wondering if there is a limit to the amount of links the script can map? I have 81 separate urls and the resulting diagram only displays around 25. Some of the links do point to the same pages though.
The sitemap appears to be well formed as well.
Cheers
Ben
Ben there isn’t a limit but it won’t produce duplicate boxes for the same page/url.
Perhaps try to remove duplicates from your list before starting and see if the output is the same?
Hi Mark
So are different urls pointing to the same page considered to be a duplicate? I guess I could just modify the sitemap manually to get a more complete diagram.
Cheers for the help, nice script by the way.
Ben
Ben it just walks/maps the hierarchy within the xml file. Each page that doesn’t have a parent is at the top level. And then its children would appear connect below that. Then their children below them. And so on.
So a unique page only has one parent in every case. if you wanted a page to show up twice you’d need to name it something else and place it in the hierarchy somewhere. And if you wanted to connect a parent to a child that isn’t their own then you’ll do do that manually after in Omni.
Good luck — and glad to help.
I’ve done all the instructions but whenever I choose the file a box pops up and says “Can’t make class document.” I click the ok button and the program shuts down.
Then if I hit the quit button I get a syntax error that says: Can’t set «class OGlt» to «constant OGldOGd2». Access not allowed.
:( What am I doing wrong?
Jason – What an awesome script you have made – this just saved me a ton of time! I want to run it again, and this time say “TAH-DAH!” Thank you, thank you.