« More silliness from SecureWorks Duo | Main | On the Zune vs iPod idiocy »
So now, one of my long standing beefs with Acrobat on the Mac has been the Office integration macros, and how PDFMaker on the Mac is really just a big dumb "Print To File" button that uses Distiller instead of the Mac PDF generation.
Adobe's reasons have always been, "We need access to things that Word on the Mac can't give us". Okay, but then I got to wondering. Why NO improvement at all? I mean, okay, so we can't get full feature parity. But nothing since Acrobat 5? That didn't sound right. So I decided to see if there weren't perhaps some things that could be done to improve the situation. I mean, even InDesign can at least render URLs in Word files, hell, so can Acrobat if you dump the Word file to HTML then import that into Acrobat.
So I got to looking and I discovered, thanks to Script Debugger's really excellent dictionary browser that lets you see what the dictionary is seeing live. (Really, if you want to use AppleScript more than once, and you don't have Script Debugger, you're being quite foolish.) In fact, there are at least two items that you can get to via AppleScript: URLs and Tables of Content, or TOC. I even took some screen shots to illustrate. First, the TOC for the document, an article I did for MacTech back in 1999:
That's a "live" TOC. If you click the page number you go to that page. Quite useful. Now, here's the screenshots for the TOC property of that same Word file in Script Debugger:
Note here, we get the four heading styles used in the TOC. Script Debugger even gives us the basic AppleScript properties statements too: "heading style 1 of table of contents 1 of active document". That's pretty handy. But it doesn't give us anything to really look for, like the text we'd need, and the page it links to. Until we get here:
If we look at the contents, we see the name of the link, and the page it links to. Wow, that's pretty handy. We now have the information required to tell us the text in a TOC entry and the page it links to. What if we didn't want to parse it all though? Not a problem, Word's dictionary gives us another way to get this information:
If we look in the sentence property of the TOC we see that the contents of sentence 1 of text object of table of contents 1 of active document gives us "NETWORK INNOVATIONS\t\3\r" which shows that there's a tab between the TOC entry and the destination page, followed by a return. Wow, not only the content and page link, but some formatting too.
What about URLs? Even simpler:
Content and text. Right there. Oh, and Word has the find feature as a part of its dictionary, and you can search by formatting too. So that's not a huge problem either.
Now, I'm not going to tell you that adding these features into the macros would be easy. I've been scripting for far too long to say that. It's not easy at all, but it's not impossible, which is what Adobe's been saying it is. It may be impossible to add in all the functionality of the Windows version, but it is not impossible to improve the existing macros. Word's VBA allows for the execution of AppleScripts, and Acrobat's rather small dictionary allows for the execution of Javascripts. So the way to go from button to AppleScript to Acrobat to JavaScript to PDF is there. (In Acrobat's miscellaneous suite it's the "do script" command and it takes either the actual Javascript text, or an alias to a Javascript file as parameters.)
That's the part that pisses me off. The Acrobat team says "we can't get to that information", yet there it is. I find it impossible to believe that no one on that team knows about AppleScript or is incapable of doing what I did to find out this information. The only reason that would let them say "Impossible" is if they only accept 100% feature compatibility with the Windows version as the minimum acceptable improvement, and it has to be done use the same code as the Windows version.
But that can't be it right? Because that would be...kinda...I dunno...silly?
Technorati Tags: Acrobat, Adobe, Adobe Applications, AppleScript, Microsoft, Microsoft Mac BU, Microsoft Word
