Re: Need help creating this script
Re: Need help creating this script
- Subject: Re: Need help creating this script
- From: email@hidden
- Date: Thu, 30 May 2002 01:39:29 EDT
Ari: There are a couple of ways you could avoid having to restart the script
for each document, but I don't think you gain much as long as you rely on
human operators to make choices in the dialogs. For example, you could:
1) Enclosing your existing script in a "repeat" statment that loops through
all of the open Quark documents. Open all of the documents that need to be
processed and launch your script.
2) Saving the script as a droplet that loops through a list of aliases,
opening and processing each document.
3) Enclosing the script in a folder action handler and then attaching it to a
folder where you put all of the documents that need processing.
You'll save a few ticks by not having to re-launch the script each time, but
the real convenience would kick in if you can tell your script how to make
decisions.
For example, have Quark ""get page width of document 1" and use that
information to set your strPageWidth. Chances are you'd have to work out a
plan for what to do with any pages that aren't exactly 8.5 or 6 inches.
Similarly, is there something Quark could look at to determine whether the
page at hand is as 'As Printed PDF'? If not, think about setting up two
folder action scripts (or two droplets), one for "as printed" pages and the
other for the other kind. In the folder action scenario, your operator would
simply drag the files to one folder or the other and processing could happen
without the operator's constant involvement.
HTH
Robert Kyle
Star Tribune
Minneapolis
In a message dated 5/29/02 7:27:43 PM, Ari Winokur writes:
>
Hey All,
>
I work for a publishing company and am working to create a script to
>
simplify my tasks. I currently have a script that basically does what
>
I
>
need. However I have to run the script over and over for each document
>
that
>
I need to work with. Please take a look at my current script (included
>
below) and get back to me on any ideas to save me the trouble of having
>
to
>
restart the script over and over. In case it is not clear from the script
>
I
>
often have to do multiple things with one document.
>
>
Thanks,
>
Ari W.
>
>
--------------
>
Ari Winokur
>
Multimedia Manager
>
Heldref Publications
>
1319 Eighteenth Street, NW
>
Washington, DC 20036
>
email@hidden
>
email@hidden
>
>
===Begin Script===
>
tell application "QuarkXPress(tm)"
>
set printer type of print setup of front document to "Acrobat Distiller"
>
>
beep
>
set dlgResult to display dialog "Choose a page width:" buttons {"8.5 in",
>
"6
>
in", "Cancel"} default button 1 with icon note
>
>
if button returned of dlgResult = "8.5 in" then
>
set strPageWidth to "51p"
>
else if button returned of dlgResult = "6 in" then
>
set strPageWidth to "36p"
>
end if
>
>
set paper width of print setup of front document to strPageWidth
>
>
beep
>
set dlgResult to display dialog "Is this an 'As Printed PDF'?" buttons
>
{"Yes", "No", "Cancel"} ,
>
default button 1 with icon note
>
>
if button returned of dlgResult = "Yes" then
>
set strFIlename to name of front document
>
else if button returned of dlgResult = "No" then
>
set dlgResult to display dialog "Name the file:" default answer
>
"File Name" with icon note
>
set strFIlename to text returned of dlgResult
>
end if
>
>
set strPostScriptFolder to "Heldref Laptop:Desktop Folder:" -- The Hard
>
Drive name mus be changed appropriately for any given computer.
>
>
set strFullFilePath to (strPostScriptFolder & strFIlename) as string
>
>
print front document PostScript file strFullFilePath
>
end tell
>
beep
>
===End Script===
_______________________________________________
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.