Advanced "Save as PDF" script that saves 2 PDF presets with 2 different Names

HI Everyone,
I am looking to improve a save as pdf workflow and was hoping to get some direction. Here is the background...
I routinely have to save numerous files as 2 separate PDFs with different settings (a high res printable version and a low res email version). Each file has to be renamed as follows...
Original filename = MikesPDF.ai
High Res PDF Filename = MikesPDF_HR.pdf
Low Res PDF Filename = MikesPDF_LR.pdf
I was able to alter the default "SaveAsPDF" script to save the files to my desired settings and to add the suffix to the name. So with these scripts here is how the workflow operates...
1. Open all files I wish to save as pdfs
2. Select script to save files as high res pdfs
3. Illustrator asks me to choose a destination.
4. Illustrator adds the appropriate suffix and saves each file as a pdf to my desired setting. ("Save As" not "Save a Copy").
5. Now all of the open windows are the new pdfs, not the original ai files.
6. Now I have to close each window. For some reason Illustrator asks me if I want to save each document when I tell it to close window, even though the file was just saved. I tell it to not save and everything seems to be fine.
7. Reopen all the files I just saved as high res pdfs.
8. Repeat the entire process except I run the script specifically designed for the low res pdfs.
What I would like to do is to combine these two processes so that there will be one script that saves both pdfs. From what I understand, the script can't support "Save A Copy" so the workflow would go as follows...
1. Open all files I wish to save as pdfs
2. Select single script to save files as both high res and low res pdfs
3. Illustrator asks me to choose a destination.
4. Illustrator saves each file as a High Res PDF and adds the the "_HR" suffix.
5. Illustrator then re-saves the open windows as a Low Res PDF and replaces the "_HR" suffix with "_LR".
Here is the code for the High Res script, The Low Res script is pretty much the same except for a different preset name and different suffix. Any pointer that anyone could give me would be most appreciated. I am pretty much a noob to this stuff so please keep that in mind.
Thanks!
Mike
---------------------------CODE----------------------------
/** Saves every document open in Illustrator
  as a PDF file in a user specified folder.
// Main Code [Execution of script begins here]
try {
  // uncomment to suppress Illustrator warning dialogs
  // app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
  if (app.documents.length > 0 ) {
  // Get the folder to save the files into
  var destFolder = null;
  destFolder = Folder.selectDialog( 'Select folder for PDF files.', '~' );
  if (destFolder != null) {
  var options, i, sourceDoc, targetFile;
  // Get the PDF options to be used
  options = this.getOptions();
  // You can tune these by changing the code in the getOptions() function.
  for ( i = 0; i < app.documents.length; i++ ) {
  sourceDoc = app.documents[i]; // returns the document object
  // Get the file to save the document as pdf into
  targetFile = this.getTargetFile(sourceDoc.name, '.pdf', destFolder);
  // Save as pdf
  sourceDoc.saveAs( targetFile, options );
  alert( 'Documents saved as PDF' );
  else{
  throw new Error('There are no document open!');
catch(e) {
  alert( e.message, "Script Alert", true);
/** Returns the options to be used for the generated files. --------------------CHANGE PDF PRESET BELOW, var NamePreset = ----------------
  @return PDFSaveOptions object
function getOptions()
{var NamePreset = 'Proof High Res PDF';
  // Create the required options object
  var options = new PDFSaveOptions();
     options.pDFPreset="High Res PDF";
  // See PDFSaveOptions in the JavaScript Reference for available options
  // Set the options you want below:
  // For example, uncomment to set the compatibility of the generated pdf to Acrobat 7 (PDF 1.6)
  // options.compatibility = PDFCompatibility.ACROBAT7;
  // For example, uncomment to view the pdfs in Acrobat after conversion
  // options.viewAfterSaving = true;
  return options;
/** Returns the file to save or export the document into.----------------CHANGE FILE SUFFIX ON LINE BELOW, var newName = ------------------
  @param docName the name of the document
  @param ext the extension the file extension to be applied
  @param destFolder the output folder
  @return File object
function getTargetFile(docName, ext, destFolder) {
  var newName = "_HR";
  // if name has no dot (and hence no extension),
  // just append the extension
  if (docName.indexOf('.') < 0) {
  newName = docName + ext;
  } else {
  var dot = docName.lastIndexOf('.');
  newName = docName.substring(0, dot)+newName;
  newName += ext;
  // Create the file object to save to
  var myFile = new File( destFolder + '/' + newName );
  // Preflight access rights
  if (myFile.open("w")) {
  myFile.close();
  else {
  throw new Error('Access is denied');
  return myFile;

Thank you for the reply Bob!
Am I correct in assuming that these few lines of code replace all of the lines that I posted above?
Also, When populating the PDFSaveOptions lines, would the end result look like this? FYI, LowRes preset name = "Proof Low Res PDF - CMYK". HighRes preset name = "Proof High Res PDF"
#target illustrator
#targetengine "main"
for (x=0;x<app.documents.length;x++)
     var workingDoc = app.documents[x];
     var workingDocFile = workingDoc.fullName;
// populate these with your settings
     var lowResOpts = new PDFSaveOptions(Proof Low Res PDF - CMYK);
     var highResOpts = new PDFSaveOptions(Proof High Res PDF);
     var lowResFile = new File(workingDocFile.toString().replace(".ai","_LR.pdf"));
     workingDoc.saveAs(lowResFile,lowResOpts);
     var highResFile = new File(workingDocFile.toString().replace(".ai","_HR.pdf"));
     workingDoc.saveAs(highResFile,highResOpts);
     workingDoc.close(SaveOptions.DONOTSAVECHANGES);

Similar Messages

  • Save Task with Different name in workspace

    Hi,
    While using SAVE button in workspace, is there a way to save tasks with different names?
    steps:
          1) Click on start Process in workspace  - Complete task order
           2) Click on save button with some data.
                      - Is it possible to change the name here?
    if there are 50 tasks named "Complete task order" in To-do list, users want the ability to rename task.
    Any help is appreciated.
    Thanks,
    Krishna

    Hi,
    While using SAVE button in workspace, is there a way to save tasks with different names?
    steps:
          1) Click on start Process in workspace  - Complete task order
           2) Click on save button with some data.
                      - Is it possible to change the name here?
    if there are 50 tasks named "Complete task order" in To-do list, users want the ability to rename task.
    Any help is appreciated.
    Thanks,
    Krishna

  • What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?

    What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?
    a. PowerShell
    b. isql
    c. osql
    d. sqlcmd

    All questions seem to be from the interview or a test. I think I even took this test once, it's KForce test.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Copying a script name with different name

    Hi,
    I want to copy my script form which has name zform1. Now i want to copy the same script form with different name i.e zform2 in the same client.
    in my se71 window i do not have a copy icon on the toolbar.
    pls. help me on how to do this.
    Thanks,
    Rose.

    Hi,
    Please follow the steps below :-
    1. Create a SCRIPT with the new name and just save it ( No need of defining any windows, just shot description is enough).
    2. Open the newly created script in change mode and go to the tab 'Form' and press 'Copy from..' .
    3. A small wondow will pop up, wherein you need to enter your previous SCRIPT name.
    4.Once done, your script will be copied.
    Please reward points if helpful.

  • TS4009 I seem to have 2 iCloud accounts with different names - a free storage that came with my Macbook and one I used when I bought some iCloud space. How can I cancel the free account?

    I seem to have 2 iCloud accounts with different names - a free storage that came with my MacBook and one I used when I bought some iCloud space. How can I cancel the free account? Because of this I can't access iMatch and the ICloud account I paid for on my MacBook
    Any ideas cos its frustrating that I can't access something I paid for!

    Sign out of the account you do not wish to use, sign into the one that you do wish to use.

  • Simple question:  White vs. Black Iphone 4 - what are the differences?  Some say that white is thinner with different camera.  Some say white is "faster"?

    Simple question:  White vs. Black Iphone 4 - what are the differences?  Some say that white is thinner with different camera.  Some say white is "faster"?

    White iPhone 4 vs. Black iPhone 4: Do They Have Different Cameras ...
    The white iPhone: Does size matter? | iPhone Atlas - CNET Reviews

  • Script that saves every visible layer as individual file in folder with same name

    Hello.
    In my PSD I have many folders with unique name (like "1234"), that contains layers named as digits (like "0", "1", "2" etc).
    I need to save each layer as JPG to folder with the same name and hierarchy that is in PSD file.
    How to do that using JavaScript .jsx scripts?
    Thank you for any response.

    What exactly is the problem – addressing the Layers, creating the Folder structure, …?

  • An apple script that saves mail attachments no longer works in lion

    In my mail rules, I have been using an apple script, which, if the sender belongs to a certain group, saves any attached files to a special folder I have for attachments from that group. After installing Lion, It performs other parts of my rule (plays a sound, for instance and moves the mesage to a special mailbox, for another), but it FAILS now to save the attachment using the script below. I hope someone knows of a workaround. If not, I hope apple will fix this soon. Here's the script--
    using terms from application "Mail"
        on perform mail action with messages theMessages for rule theRule
            tell application "Mail"
                repeat with oneMessage in theMessages
                    set {mail attachment:theAttachments} to oneMessage
                    repeat with oneAttachment in mail attachments of oneMessage
                        save oneAttachment in ("i828:Users:i8:Desktop:Poker Player:PPlayattach2") & (name of oneAttachment)
                    end repeat
                end repeat
            end tell
        end perform mail action with messages
    end using terms from

    This worked brilliantly!
    Thanks
    David

  • Recieve a PDF Form that cannot be tampered with and then sent to  a Database?

    Hi,
    I have created a PDF form in Designer 7 and sent it to myself as a test as a PDF attachment, which worked fine.
    Receiving the PDF form, I notice I can change the drop down fields etc which makes it possible to tamper with the sent information.
    Is there a way to fill out the form and when sending it back, it cannot be edited in any way?
    I also read in one of the Adobe Acrobat books, I think it was the Adobe Acrobat 7 in a Classroom book, that it was possible to import a returned PDF file into your own PDF Form that has a button than can update an Access Database file, but was "beyond the scope of this book".
    Is there a dedicated book I can purchase for Designer 7 which covers Database connectivity etc?
    Cheers.

    I too would like to know how to update a database microsoft access. I have forms that people fill out that has to be imported into access to update records. One update and one import.
    I also, need to automate the creat pdf/from scanner and save format.
    Thank you in advance for all your help.
    Coni

  • Why Adobe Reader XI cannot open a pdf file that can be opened with Reader 9?

    Why Adobe Reader XI cannot open a pdf file within a browser that can be opened with Reader 9?

    Hi Steve,
    Sorry, I cannot post a URL to the file because it is for intenal use only.
    I noticed that the pdf file can be opened outside of IE browser if I disable the Adobe Reader add-on (active-X) in IE browser. If I enable the Reader add-on, the Reader cannot complete the file download. The progress bar goes in a half way, and stays there.
    Just FYI, the pdf file was created by Distiller 7. Do you think it is the issue of Reader add-on? Thanks.

  • SDK creating PDF files that will not print with pcl6

    We are using the PDF SDK 7.1 to create PDF files from our application on Windows. The PDF files mostly consist of PATH elements representing 2D graphics. We have customers that have trouble printing them from Acrobat on PCL6 printers, they either get a memory error, or an error that there is not enough memory.
    As a workaround, they have used Ghostscript to create the PDF files, then they have no problem printing the files. I am at a loss to see what could cause the problem. Are there tools to analyze a PDF file that could help? I tried PDF CanOpener, and it didn't help much.
    We are using PDSaveLinearized when we close the document. Any help, ideas or suggestions would be appreciated.
    Thanks,
    Keith Hafen

    What version of Acrobat is being used on what OS platform to print to what PCL6-based printer?

  • PDF forms and how they work with different Reader versions

    I'll start this off by giving a little background information and describing a workflow scenario. I work as an InHouse designer for a company that keeps the majority of the employee population always a few versions behind. Fortunately, for us designers they keep us updated, but it doesn't always play nicely when you're saving your PDFs for older versions of Acrobat Reader.
    What happens is that I create a form in InDesign, export a PDF, and then create my form fields in Acrobat Pro 9 on a Mac. After saving for version 9 I then take the PDF and test within the Windows environment which our IT is enforcing Acrobat Reader 7. The PDF opens ok and I can fill out the form, but I cannot save. I then open in Acrobat Pro 7 for Windows and then it gives the option to save or make modifications.
    My questions really come down to whether or not Reader 7 is doing this because of how old the technology is, or if that would change if our IT would allow Acrobat Reader 8 or 9? Now I've looked at the Acrobat Pro 9 comparison chart and it states "Enable users of Adobe Reader®   (version 8 or later) to fill in and save PDF forms locally." Does this mean that we just need version 8 or 9 and then people can save the form? What in version 7 is causing us not to be able to save? Did that change the technology in some way? I'm trying to figure out if we get IT to upgrade users to Reader 9 if this will solve the issue or will they have to install Acrobat Standard/Pro 9 to save a PDF form?
    What other selling points could we make to our IT department that using Reader 9 is a lot better than using Reader 7? Any technology benefits, security or functions?
    Thanks

    ~graffiti wrote:
    No version of Reader can save a filled in form unless it has been enabled first.
    To enable, open the file in Acrobat then go to Advanced>Enable usage rights in Adobe Reader...
    And for my standard disclaimer, if you are going to use the forms in a corporate environment, be sure to study and understand the usage limits for enabled forms (the limit is 500 uses, but there are caveats to that) in the EULA. Mostly the enabled forms are meant for very small time users. If you do not meet that requirement, Adobe sells another product that can enable files for unlimited uses but it costs in the tens of thousands of dollars and is a server side solution.
    Hey Graffii,
    I enabled the usage rights and that did help with saving in Reader 7. I am a little concerned about the limit of 500 uses. Let me try and understand you a little better. I have a PDF that has a couple form fields and you're saying that the PDF can only be opened 500 times? I've never heard of restrictions on PDFs before. Does this happen after you place just 1 form field? How do I find out more information? I looked in the EULA, but found nothing.
    Also, what does Adobe mean here "Enable users of Adobe Reader®   (version 8 or later) to fill in and save PDF forms locally." Are they saying that you need Reader 8 or later to read a form or that you need Acrobat Pro 8 or later to enable the form feature?
    It's all very confusing because one of the features they tout in version 9 is the ability to save forms locally, but once I enable the form I could save it with Reader 7. It's hard to tell if they are referring to Reader 9 or Acrobat Pro 9.
    Thanks

  • Keep getting a read only message and have to save with different name

    I am editing some pdf files, and every time I save I get the message: "The file may be read only, or another user may have it open.  Please save the document with a different name or in a different folder."
    However, when I right click the file and click properties, it is not listed as a read only file.  Nor is the directory read only.   Having to save each file as a different name is driving me nuts.   Is there a fix?

    Is this file saved on a network drive, or a shared folder?
    If so, it's possible someelse in the network has it open at the same time as you.

  • How do I save document with different name

    Since I updated my softwhere, can't seem to find how to "save as"....help!

    Hi Draomin,
    Your profile shows this:
    Draomin's Products
    iMac, Mac OS X (10.7.5)
    iPad, iOS 6.1
    Mac Book Pro 17", Mac OS X (10.4.6), 1 Gig/Manuf date of April 2006
    Mac Pro, Mac OS X (10.6.8)
    MacBook Pro, Mac OS X (10.7.5)
    If your profile is correct, then I surmise that you are using OSX Lion. "Save As" is not available in Lion.
    Your options:
    1. Upgrade to Mountain Lion. You will see that "Save As" is back. You will find "Save As" by holding down the option (alt) key when you use the File menu in Pages, Numbers, TextEdit and other apps under Mountain Lion.
    2. Stay with Lion and learn how to use "Duplicate". It is not hard.  See my replies to this thread:
    https://discussions.apple.com/message/21418250#21418250
    3. Stay with Lion and don't bother to learn how to use "Duplicate". Join the 38574 Views 1,085 Replies on what I call the Whinge Thread:
    https://discussions.apple.com/thread/3216589?start=0&tstart=0
    Your choice.
    Ian.

  • .PDF file transfer(SAP XI ) along with file name to SAP R3

    I would like to transfer a .PDF file along with its file name to target system.I need to have target structure like,
      <Target>
        <field1>
        <Field2>
    /Target>
    Field1should be mapped to file name( i can do this by using dynamic configuration and a UDF).
    Field 2 should me mapped to .PDF imae (.ie) i need tp pass the whole image to one target field
    How can i do this.
    Please suggest.

    Hi as mentioned by you the structure is
    <Target>
        <field1>
        <Field2>
    </Target>
    Field 1 Contains The dynamic File name UDF
    Just make This File name which is sent Thru Source side as "Filename.PDF" to be passed to the target end
    For example If the File name is XYZ
    Field 1 has XYZ--
    Pass The Field 2 as "XYZ.pdf" (i.e. File name Followed By .pdf as extension(Field1.pdf))

Maybe you are looking for

  • Itunes for windows won't open

    clicking on the itunes icon does nothing, nor trying from the program list. I removed itunes & reinstalled it (downloading from apple), tried the repair option, tried downloading to a different drive, but nothing. I'm wondering if this is a problem w

  • Palm V will no longer sync with desktop software

    I am a Volunteer here, not employed by HP. You too can become an HP Expert! Details HERE! If my post has helped you, click the Kudos Thumbs up! If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you

  • How to size images to 1024x768 pixels in iPhoto7.1.4?

    As a member of a local photo club I am required to size my jpeg images to 1024 x 768 pixels and I have not been able to do that in iPhoto? Is there a way? (Does 1024 x 768 pixels equal 3"x5"?)

  • Automatic Creation of Batch in Process Order Confirmation

    Hi Guru, What are settings required to set the batch creation automatic during the confirmation of the process order? The header material is semifinished and batch management is ticked in the material master. BOM has been created. In the present scen

  • Console shows web application deployed to server but not to the virtual host yet things still work, huh?

    I finally figured out how to get the virtual hosting piece to work in wls811. Now I have a question about the console presenting me with some web app information. The Web Application Modules node and the Deploy tab shows me the application is deploye