Print window: Can "PDF" menu/button be scripted?

D

dan.caugherty

Hey all --

I'm chasing after the holy grail of Applescript with Word: saving
documents as PDFs.
So far, I've found no information on how to do this through Word
directly, so I'm considering
using the System Events app to do the dirty work.

Now, I can get the Print window to appear this way, but I have no idea
how to select
the "PDF" drop-down menu in the left hand lower corner of the window
near the Help button.
(You may have guessed already that I'm using Word 2004 and Tiger.)

Would anyone out there know what the magic Applescript incantation
would be at this point?

Thanks in advance,
-- Dan C.
 
M

matt neuburg

I'm considering
using the System Events app to do the dirty work.

Now, I can get the Print window to appear this way, but I have no idea
how to select
the "PDF" drop-down menu in the left hand lower corner of the window
near the Help button.

Then get PreFab UI Browser. If it can be done, UI Browser will instantly
tell you how. (Of course, it might be impossible; GUI scripting doesn't
usually work at all with Microsoft products.)

m.
 
D

dan.caugherty

Hi Matt --
Then get PreFab UI Browser. If it can be done, UI Browser will instantly
tell you how. (Of course, it might be impossible; GUI scripting doesn't
usually work at all with Microsoft products.)

Hmm. Tried that, didn't seem to work; UI Browser won't follow me to the
Print
window.

Unless of course I'm misusing UI Browser. Is it possible to set UI
Browser
to work like the UI Inspector that Apple provides on its developer
site, so
that I can have a script to use an arbitrary visible UI element?
 
M

matt neuburg

Hi Matt --


Hmm. Tried that, didn't seem to work; UI Browser won't follow me to the
Print
window.

Not sure what you mean by that. I know what ui element this is. But that
doesn't make it GUI-scriptable, as I said earlier. m.
 
D

dan.caugherty

Well, as you'd expect, Unix comes to the rescue. Particuarly, the
Common Unix Printing System (CUPS) in OS X. The following link will
show the required "end run" around Word by creating a virtual printer
that is dedicated to producing PDFs:

http://www.macosxhints.com/article.php?story=20031116190809396

Attention Tiger users: Be sure to follow all Tiger-related threads in
the topic above to tweak your system as necessary. This worked out of
the box for me!

Cheers,
-- Dan C.
 
A

Aaron Wood

Dan, If you have successfullly gotten an applescript to convert
(print?) word .doc files to a pdf I would love to use that applescript
to do the same thing. Let me know what, if anything, would prevent you
from sharing it here or with me.

Thank you,
Aaron
 
P

Paul Berkowitz

Dan, If you have successfullly gotten an applescript to convert
(print?) word .doc files to a pdf I would love to use that applescript
to do the same thing. Let me know what, if anything, would prevent you
from sharing it here or with me.

There's absolutely no way in Tiger (where the PDF button was changed to a
drop-down and is no longer accessible to "GUI scripting": same is true in
all applications, not just Word; it's an OS dialog button). If you're still
in Panther, it should be possible using "GUI scripting".

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top