Scripting for dialogs oin OS X
Scripting for dialogs oin OS X
- Subject: Scripting for dialogs oin OS X
- From: "Paul Bunch"<email@hidden>
- Date: Thu, 27 Jun 2002 09:07:23 GMT
Here's a copy of some discussion I've been involved in on the Office:mac beta
list, which I'd like to submit for any further ideas from the Scripting
community....
Thanks for this Jason, I'll have a go to see what I can do with it.
I've already got something that works quite well - mostly thanks to Paul
Berkowitz - but I'm always looking to improve and gain more flexibility.
My biggest problem right now is where some applications put up dialogs for
printing, saving and font substitution. The Office suite isn't too bad, for this
but using "close (filename) saving no" does'nt always work, even in in some apps
that claim to support this (of course this might be only supported in OS 9 in
some cases).
I have been able to use VBA a bit with the Office:mac v X apps, but it would be
easier to get more control if the VB help examples were more comprehensive (i.e.
containing more optional parameters in example format). For instance it would be
nice if there were some demonstration code showing how to set landscape
orientration, multi-up, duplex and fit to page. Guess I'll have to dream on
though ;-)
Regards and thanks again,
Paul
-----Original Message-----
From: <email@hidden>
Sent: 26 June 2002 11:41
To: "Powerpoint Beta List" <email@hidden>
Subject: RE: Scripting support across the office apps inconsistent
Here's part of a script I've used for printing Word, Excel, and PPT
files in the past. I haven't tried it lately, so your mileage will
vary. There are different commands you have to use for different apps
and the adjustments you want are not present, but you may be able to
leverage whatever parameters are available with the VBA printout method.
Good luck,
--jason
repeat with aFile in fileList
with timeout of 300 seconds -- that's 5 minutes
to do 1 command
-- all of the remaining files should be
used/tested
set staFile to (aFile as string)
tell gTargetApp
set stFileName to (name of
aFile) as text
if (iAppType = gcWordApp) then
using terms from
application "Microsoft Word"
open staFile
my
waitForWindow(stFileName, 1, 10)
do Visual Basic
"activedocument.printout"
close window
stFileName saving no
end using terms from --
Word
else if (iAppType = gcExcelApp)
then
using terms from
application "Microsoft Excel"
-- we'll get the
dialog for printing. user must hit ok
set theWbk to
Open (staFile as Unicode text)
my
waitForWindow(stFileName, 1, 10)
Print theWbk
Copies 1
Close
ActiveWindow saving No
end using terms from --
Excel
else if (iAppType = gcPPTApp)
then
using terms from
application "Microsoft PowerPoint"
reopen
--do Visual
Basic "application.presentations.open " & staFile
open aFile
--my
waitForWindow(stFileName, 1, 10)
delay 5 -- might
not be enough of a delay, but since we can't detect windows...
do Visual Basic
"activepresentation.printout"
do Visual Basic
"activepresentation.close"
end using terms from
else -- iAppType better be
gcUnknownApp
open aFile
print stFileName
close stFileName
end if
end tell
end timeout
end repeat
-----Original Message-----
From: Paul Bunch [
mailto:email@hidden]
Sent: Friday, June 14, 2002 2:17 AM
To: Powerpoint Beta List
Subject: RE: Scripting support across the office apps inconsistent
I realise this Dan, but the goal, once the "simple" print scripts are
working, is to develop the scripts from that point to adjust for things
like page setup for orientation changes and fit-to-page.
Also/eventually to adjust for a variety of print "finishing" options and
stitch the indivudual scripts together to create print autotesting
across the whole range of scriptable applications.
So it's about control over the output and scripting the creator
application looks like the only way I can achieve this.
Regards
Paul
-----Original Message-----
From: <email@hidden>
Sent: 13 June 2002 09:23
To: "Powerpoint Beta List" <email@hidden>
Subject: Re: Scripting support across the office apps inconsistent
Why a last resort? That's exactly what it's designed to do.
Dan
On 6/13/2002 2:20 AM, "Paul Bunch" <email@hidden> wrote:
>
Thanks Dan,
>
I wanted to only use this as a last resort, but I'll hold it in
>
reserve.
>
>
Regards
>
>
Paul
>
>
-----Original Message-----
>
From: <email@hidden>
>
Sent: 12 June 2002 16:16
>
To: "Powerpoint Beta List" <email@hidden>
>
Subject: Re: Scripting support across the office apps inconsistent
>
>
>
On 6/12/2002 11:02 AM, "Paul Bunch" <email@hidden> wrote:
>
>
> All I want to do is open each office app, get lists of files from
>
> directories and batch print them without having to confirm any
>
> dialogs manually.
>
>
I don't know if it'll work, but have you tried doing this through the
>
Finder?
>
>
tell application "Finder" to print alias "foo"
>
>
Dan
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.