From: Tom Harrington on
In article <018c135b$0$11348$c3e8da3(a)news.astraweb.com>,
JF Mezei <jfmezei.spamnot(a)vaxination.ca> wrote:

> Tom Harrington wrote:
>
> > I don't know if your copy of Word is Applescript-able but that's the
> > first thing I'd check. If it's not, or not easily scriptable, try
> > looking at TextEdit, which is. If your Word documents aren't too
> > complex it'll probably do just fine with them.
>
>
> The telco who produces those .docs use a type of paragraph numbering
> that is not supported by textedit (or at least under tiger, I guess I
> should check again). Having paragraph numbers in important when quoting
> their stuff.

Well, Word 2008 is scriptable. I don't know about the version you have
but it's still the first place I'd look.

--
Tom "Tom" Harrington
Independent Mac OS X developer since 2002
http://www.atomicbird.com/
From: David Empson on
Tom Harrington <tph(a)pcisys.no.spam.dammit.net> wrote:

> In article <018c135b$0$11348$c3e8da3(a)news.astraweb.com>,
> JF Mezei <jfmezei.spamnot(a)vaxination.ca> wrote:
>
> > Tom Harrington wrote:
> >
> > > I don't know if your copy of Word is Applescript-able but that's the
> > > first thing I'd check. If it's not, or not easily scriptable, try
> > > looking at TextEdit, which is. If your Word documents aren't too
> > > complex it'll probably do just fine with them.
> >
> >
> > The telco who produces those .docs use a type of paragraph numbering
> > that is not supported by textedit (or at least under tiger, I guess I
> > should check again). Having paragraph numbers in important when quoting
> > their stuff.
>
> Well, Word 2008 is scriptable. I don't know about the version you have
> but it's still the first place I'd look.

Word 2008's AppleScript dictionary has a command "save as" in the
Microsoft Word suite which lets you specify the format.

The following general syntax works, assuming the document you want to
save as PDF is the only one open in Word, and outPath is set to a string
containing the full pathname to the output file, in standard Macintosh
format (many ways to generate that).

tell application "Microsoft Word"
save as document 1 file name outPath file format format PDF
end tell

Talk about convoluted syntax. Yes you really do need to say "file format
format PDF".

Add additional AppleScript as required to iterate through opening and
closing each Word document, or perhaps create an Automator script with a
little AppleScript to do the grunt work.

I couldn't see an obvious equivalent in Office v.X, and don't have
Office 2004.

I can't see how to perform a "Print to PDF" via AppleScript in any
application I've looked at, so "Save as PDF" is likely to be the best
plan of attack.
--
David Empson
dempson(a)actrix.gen.nz
From: JF Mezei on
David Empson wrote:

> I can't see how to perform a "Print to PDF" via AppleScript in any
> application I've looked at, so "Save as PDF" is likely to be the best
> plan of attack.


Word 2004 doesn't have "Save as" with a format of PDF :-( :-( I have to
print, and then "save as PDF" from within the apple print dialogue.

Arghhh ! Damned you Bell Canada for submittting official documents in
that damned file format. Why can't you submit stuff in .PDF like
everyone else ?


Just tried www.doc2pdf.net It is a web based translator and it does seem
to find the paragraph numbers, but the graphics don't seem to be handled
enterely reliably.
From: David Empson on
JF Mezei <jfmezei.spamnot(a)vaxination.ca> wrote:

> David Empson wrote:
>
> > I can't see how to perform a "Print to PDF" via AppleScript in any
> > application I've looked at, so "Save as PDF" is likely to be the best
> > plan of attack.
>
>
> Word 2004 doesn't have "Save as" with a format of PDF :-( :-( I have to
> print, and then "save as PDF" from within the apple print dialogue.
>
> Arghhh ! Damned you Bell Canada for submittting official documents in
> that damned file format. Why can't you submit stuff in .PDF like
> everyone else ?

Another approach you might be able to investigate:

At least for some applications, the "print" command in AppleScript has
print settings which let you specify a printer by name. If you have
CUPS-PDF installed, you might be able to use it to print to PDF under
AppleScript control.

http://www.macupdate.com/info.php/id/20219

Unfortunately CUPS-PDF doesn't work in Snow Leopard (yet).

--
David Empson
dempson(a)actrix.gen.nz
From: Tom Stiller on
In article <1jcjjah.40xj3x0eq0dN%dempson(a)actrix.gen.nz>,
dempson(a)actrix.gen.nz (David Empson) wrote:

> JF Mezei <jfmezei.spamnot(a)vaxination.ca> wrote:
>
> > David Empson wrote:
> >
> > > I can't see how to perform a "Print to PDF" via AppleScript in any
> > > application I've looked at, so "Save as PDF" is likely to be the best
> > > plan of attack.
> >
> >
> > Word 2004 doesn't have "Save as" with a format of PDF :-( :-( I have to
> > print, and then "save as PDF" from within the apple print dialogue.
> >
> > Arghhh ! Damned you Bell Canada for submittting official documents in
> > that damned file format. Why can't you submit stuff in .PDF like
> > everyone else ?
>
> Another approach you might be able to investigate:
>
> At least for some applications, the "print" command in AppleScript has
> print settings which let you specify a printer by name. If you have
> CUPS-PDF installed, you might be able to use it to print to PDF under
> AppleScript control.
>
> http://www.macupdate.com/info.php/id/20219
>
> Unfortunately CUPS-PDF doesn't work in Snow Leopard (yet).

Yes it does, but the output folder must be located in
/var/spool/cups-pdf. I use an alias to mimic the old behavior on Snow
Leopard.

I believe there was also one file in the package which required a change
of permissions, but I can't recall its name.

--
Tom Stiller

PGP fingerprint = 5108 DDB2 9761 EDE5 E7E3 7BDA 71ED 6496 99C0 C7CF