printing from finder

M

markrjl

Sorry if this has been asked before. Is it possible to print a word doc
from the finder without opening word?
 
D

Daiya Mitchell

Sorry if this has been asked before. Is it possible to print a word doc
from the finder without opening word?
No, don't think so. You can drag the file onto the printer, though, and if
you then ignore it, the computer should launch Word, print the doc, and
probably quit Word again, without you doing anything. (so Word has to open,
but you don't always have to open it)

What version of OS and what version of Word? In OS 9, I think you can use
File | Print instead of dragging around icons. In OS X/Word 2004, there
seems to be a bug where you can only do one doc at a time.
 
M

markrjl

10.3 and Office 2004. I was hoping someone might have scripted this by
now but perhaps it is not possible. I seem to remember OS9 having this
function and I have it on my PC. I have created a printer alias on my
desktop but dragging a word doc there opened word with a blank page!.
 
J

John McGhie [MVP - Word and Word Macintosh]

It is a trivial matter to script this from AppleScript (if you happen to
know AppleScript... I must get around to it...)

However, it's not possible to do it without "launching" Word. You can run
Word as a hidden instance in the background so that the user is not aware of
it. You could put your AppleScript on your right-click so you don't have to
think about it. But you do have to have the Word engine running to decode
the document and hand it over to the print engine.

Cheers


10.3 and Office 2004. I was hoping someone might have scripted this by
now but perhaps it is not possible. I seem to remember OS9 having this
function and I have it on my PC. I have created a printer alias on my
desktop but dragging a word doc there opened word with a blank page!.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
D

Daiya Mitchell

10.3 and Office 2004. I was hoping someone might have scripted this by
now but perhaps it is not possible. I seem to remember OS9 having this
function and I have it on my PC. I have created a printer alias on my
desktop but dragging a word doc there opened word with a blank page!.
And are you saying it *didn't* print your document?
 
M

markrjl

Thats right, the document did not print. Does it work for anyone else?
I wonder how my pc prints without opening word?

I like the idea of work opening in the background, printing then
closing again. I have downloaded the script document for word but with
no programming experience I think I would be wasting my time.

Thanks for the replies.
 
M

markrjl

OK my first attempt at a script: this prints a blank page even when I
choose a doc with plenty of content. where do I go from here? How do I
get the script to chose a document by "right clicking" on it? How do I
get Word to close after?

Any help welcome

tell application "Microsoft Word"
set thisFile to (choose file with prompt "pick file")
print thisFile
print
end tell
 
M

markrjl

This seems to work. Is this what I have seen referred to as a droplet?



on open
tell application "Microsoft Word"
open thisFile
print out thisFile
end tell
tell application "Microsoft Word"
quit saving no
end tell
end open
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Mark:

I wonder how my pc prints without opening word?

It doesn't. It opens Word in the background, just like the Mac does.

Word on the PC will take command-line switches Start>Run>winword.exe "name
of document.doc /p will start Word and throw a document at it to print to
the default printer in the background.

The Mac equivalent has no documented command line switches :)

Cheers

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
P

Paul Berkowitz

This seems to work. Is this what I have seen referred to as a droplet?

Yes. The 'on open' handler turns a script application (applet) into a
droplet on which you can drop files. But it should be followed by a variable
representing a list of files (or just one file, like 'thisFile', if you
insist). There's a very friendly coercion helping you out here instead of
erroring. This version will let you drop any number of Word files on it, and
will ignore any non-text files you might have included by accident. It would
need a bit more work to allow for a _folder_ containing files.

It's also ignoring the command to print out thisFile since it only prints
Word documents, not files. It's defaulting to 'application', i.e. it's just
doing a print out without an object.

Try this:


on open theFiles
tell application "Microsoft Word"
repeat with thisFile in theFiles
try
open thisFile
print out active document
close active document saving no
end try
end repeat
quit saving no
end tell
end open

on open
tell application "Microsoft Word"
open thisFile
print out thisFile
end tell
tell application "Microsoft Word"
quit saving no
end tell
end open


--
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.
 
M

markrjl

Thank you both for the replies. Can I open office applications in the
background on a mac?
 
P

Paul Berkowitz

Thank you both for the replies. Can I open office applications in the
background on a mac?

Using AppleScript:

tell application "Microsoft Word" to launch

You have to have General Preferences set to not open the Project Gallery
however. But in Panther it's doing something odd: the precious app
theoretically is still in the front (you'll see it listed as the active app
in the left menu) but none of its windows are, if saved run as an
application (meaning you always have to double-click in the Finder, so the
Finder will always sort-of come to the front). Word's default Document1
window is most visible (sort of semi-dimmed). Instead, run it as a script
from the Script menu:

So what you want to do is this:

1) Go to /Applications/AppleScript/ and double-click the Install Script Menu
file you see there if you've never done it. That puts a Script menu over on
the right side of the main menu bar.

2) Select "Open Scripts Folder" at the top of that script menu, which will
create a Scripts folder in ~/Library/.

3) In Script Editor, save the following script as a Script (called "Launch
Word", or similar) in ~/Library/Scripts. (~/ means your OS X user folder.)


tell application "System Events"
set wordIsOpen to exists process "Microsoft Word"
end tell

if not wordIsOpen then
tell application "Microsoft Word"
launch
close document 1 saving no
end tell
end if


Doing it this way ensures that you won't accidentally get rid of a genuine
front document unsaved in the front if Word happens to be open in the
background already.

--
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.
 
M

markrjl

Neat. I am beginning to see the point of applescript at last. I can
combine these scripts to print from finder which was what I set out to
do. Thanks again.
 

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