• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need help creating this script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help creating this script


  • Subject: Re: Need help creating this script
  • From: email@hidden
  • Date: Thu, 30 May 2002 11:57:05 EDT

Here are some thoughts, in no particular order:

1) If you want batch processing capabilities, you can build an instruction file (use a tab delimited text file) in the format:

srcFile strPageWidth strFIlename

so that your instruction file might look like:

firstSourceFilename 51p firstDestFilename
secondSourceFilename 36p secondDestFilename

Your script can then read this instruction file and cycle thru each document automatically. Such a tab delimited file can be created in a spreadsheet, then copied and pasted to BBEdit to make it tab delimited.

Another plan would be to give your script an "on open" handler and drop a group of files onto it. Or use folder actions.

You may want to check out my "List Manipulator" at

http://www.linkedresources.com/tools/listmanipulator_v0.31b1.shtml

It may help you create the instruction file.

2) This line

set strPostScriptFolder to "Heldref Laptop:Desktop Folder:" -- The Hard Drive name must be changed appropriately for any given computer.

would be better structured as

property strPostScriptFolder: "Heldref Laptop:Desktop Folder:"

and placed at the top of your script with the comment line above it as follows:

------- this/these values must be localized ----------

This makes it easier to distribute scripts, and to debug/modify. You won't have to dig thru your script hunting for (and missing) the necessary localizing changes.


Jeff Baumann
email@hidden
www.linkedresources.com


In a message dated 5/29/02 8:28:52 PM, Ari Winokur wrote:

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

  • Prev by Date: RE: Extracting path of application
  • Next by Date: Re: Need help creating this script
  • Previous by thread: Re: Need help creating this script
  • Next by thread: Re: Need help creating this script
  • Index(es):
    • Date
    • Thread