PDF of naming when exporting using a part of the file name (JS) IDCS4

I have a script that will use a PDF Export Preset for each page of a document to export individually. The script uses the ID name of the document and adds a "_Final.

For example:

Identity name to docs:

138-140 TEST 10_WORKER.indd

Name of the final PDF:

138-139 TEST 10_WORKER_Final_1.pdf

138-140 TEST 10_WORKER_Final_2.pdf

138-140 TEST 10_WORKER_Final_3.pdf

The first three digits represent the first page number in the document. I want to use these numbers and add gradually to the following PDF page numbering. I'm looking to do using our standard naming convention that looks like this...

MYTEST_138.PDF

MYTEST_139.PDF

MYTEST_140.PDF

Any guidance would be greatly appreciated. Thank you!

Hey Danny,

It will help you some.

If (app.documents.length! = 0) {}

var myFolder = file ("" ~ / Desktop "");

If (myFolder! = null) {}

var myPageName, CheminMonFichier, myFile;

myDocument var = app.activeDocument;

var my_suffix = parseInt ((app.activeDocument.name) .substr (0.3))

If (typeof (my_suffix)! = 'number')

{

Exit();

}

for (var myCounter = 0; myCounter< mydocument.pages.length;="">

If (. appliedSection.name myDocument.pages.item (myCounter)! = "") {}

myDocument.pages.item (myCounter).appliedSection.name = "";

}

myPageName = myDocument.pages.item (myCounter) .name;

app.pdfExportPreferences.pageRange = myPageName;

CheminMonFichier = myFolder + "/" + "MYTEST_" + (my_suffix + myCounter) + ".pdf";

myFile = new File (myFilePath);

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

myDocument.exportFile (ExportFormat.pdfType, myFile, false, "Type the name of your pre-defined here PDF file");

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

}

}

}

else {}

Alert ("no document is open. Please open a document and try again. ») ;

Exit();

}

Alert ("Done");

Shonky

Tags: InDesign

Similar Questions

  • Cannot find filename when looking for a part of the file name.

    I'm just trying to do a simple search.  I have a few hundred files in a number of subfolders and above I'm looking for right in the file name (in the upper right corner of the browser) and he doesn't find anything.  This is getting very, very frustrating.  It seems to randomly find some files... but no more.

    Is there some settiing I need to change?  What is the problem?

    Well - I thought of her.  Despite light in several places that the 7 search automatically applies a generic search at both ends of your criteria, is not.  So, let's say that I was looking for the file name "aaaxyzbbb.txt"... the search for "xyz" found nothing.  But "* xyz" found what I was looking for...

  • Given the file name or path contains Unicode or DBCS characters. Retry using ASCII characters for the file name and path whatever that means? This happens when I publish an OAM

    Given the file name or path contains Unicode or DBCS characters. Retry using ASCII characters for the file name and path

    What does that mean? It happens when I try to publish an OAM for Dreamweaver.

    Also: How can I specify the onboard browser animate? It's just going as far. Are there no preference to animate it dashboard?

    BTW. Just call him edge. Seriously. You call Illustrator draw? Photoshop editing?

    No, my file name is mainContent.oam

    My project name is mainContent.an

    This error occurs when I try to import into Dreamweaver. Sorry, I was unclear about that earlier.

    I thought maybe it was because I had saved my image as a png image. So re-saved as an svg, still get the error.

    Should I have a setting is CC of Dreamweaver that will not? I should try this in Dreamweaver CS6? I might try that next.

    Why is this so difficult program? I know that Flash. I know that After Effects. I can work the chronology part simply awesome. He's still export I have problems.

    On a MacPro, 10.7.

    You are a person of Adobe or simply a beautiful assistance program?

  • When you use quite imposing, more the file obtained only receives a Temp name that will be sent as a document name.

    Our company has recently updated form Acrobat 8 Professional for Acrobat Professional XI. We also use him very imposing more plug-ins in both versions. Now, when quite imposing and the resulting file is only given a name of Temp that will be sent under the name of the document to the printer unless the imposed document is the first recorded. This was not the case in Acrobat 8 Professional. I've attached screenshots which shows an example.

    quite.jpg

    Is there a reason why this is happening and how we can stop it.

    Adobe and Acrobat do not control it. The name of the file and its location is quite a large function.

    For more help on this issue, please communicate with any software.

    -Dov

  • Sorting files in folders from the parts of a file name

    Hello

    I have a library of images that I need to build to work. The images have been recorded as this for example

    Dolce & Gabbana - the One_EDT_50ml.jpg

    There are 1000's of brands, so I need a script that looks for the part of the file name before the hyphen. and create a folder based on all the images that fall under this brand.

    If anyone can help?

    I've never used script before, but any solution I can work with that will work for me.

    Thank you

    Use the following syntax:

    Tell application "Finder".

    Repeat until (files window count 1) is 0

    the value the_offset to compensate for the "-" (get the window 1 1 file name)

    the value the_name items 1 thru (the_offset - 1) (get the filename window 1 1) as string

    move (all files 1 window whose name begins with the_name) (making the new file to the window 1 with properties {name: the_name})

    end repeat

    tell the end

    (143816)

  • I used to have installed on my pc Adobe Reader XI (11.0.10). I went for a few days, and when I logged on my pc I have installed Adobe Acrobat Reader DC. With this new software, I can't print my PDF now. When I try to print in the print area, I

    I used to have installed on my pc Adobe Reader XI (11.0.10). I went for a few days, and when I logged on my pc I have installed Adobe Acrobat Reader DC. With this new software, I can't print my PDF now. When I try to print in the print area, I see all documents print, the rest is grey. When I press print it tells me that it cannot print the document because its now been selected. I have been on various forums, and no one can help me. I am at a total loss what to do. Can you help me please?

    Sorry, I don't understand what you're trying to say ("' I see print all documents ', ' because it's now been selected" ").

    Can post you the screenshots of these messages: https://forums.adobe.com/thread/1070933

  • Can I use the part of a file name in a watermark?

    Hello

    I have a lot of files to .tif I need to convert to PDF and then affix a unique watermark.

    This watermark will be based on the file name, but only a part of it. For example a document with file bmw06125_x_1.pdf name should be stamped with a watermark indicating something like "see mw06125".

    So basically, what I need is the mw06125 of the file name part to be part of the watermark is it possible with my copy of Acrobat Pro.

    I am very new to this software and I still have to use it effectively, but I don't know that it will allow me to automate a large number of stamping and conversion. I was also wondering if it was possible to use Excel spreadsheets as part of automation, because I am able to write a formula that will allow to create the name.

    Any help would be appreciated.

    -Alistair

    You can use the wizard from the Action with JavaScript for this.

  • I have problem with a .iso file that when I want to use I face the error "the file name is too long.

    Original title: name of a file

    Hello

    I have problem with a file .iso that when I want to use I'm dealing with error "the file name is too long" and I can't use this file anywhere for example: vmvare ' untraiso and even if I cannot write to cd or make a boot USB.

    I don't know how fix it.how I rename the file iso, shorter that I can use?

    Please help me.

    Thank you.

    Right-click on the ISO > rename > give a short name

  • Halo 2:When I use my mouse on the line, the cursor movement is very slow and jerky.

    original title: halo 2

    Hello... Just installed Halo 2 on my Windows 7, 64-bit desktop.  I have all the latest drivers. All other games work fine.

    When I use my mouse on the line, the cursor movement is very slow and jerky. Unplayable.

    I was looking for a patch for the game or suggestion on how to correct adjust them.  I tried the option in game of adjustment of moving the mouse, but it did not help.

    Suggestions please...

    ----------------

  • When I use a Web browser, the number line doesent work,

    When I use a Web browser, the row, knit doesent number, he repeated that the last letter typed as I type k and press any number and slap k again, that has started after a windows update, how to fix?

    If you are a customer of Comcast and constant guard is installed, see this discussion: http://forums.comcast.com/t5/Security-and-Anti-Virus/Constant-Guard-Numeric-Keyboard-Problem/td-p/926185

    If this is not the case, is installed GuardedID?
    http://www.GuardedID.com

    Partners:

    Constant guard (Comcast)
    http://security.Comcast.NET/constantguard

    Keep constant - keypad problem? (May 02-11 & ff)
    http://forums.Comcast.com/T5/security-and-anti-virus/constant-guard-numeric-keyboard-problem/TD-p/926185

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    You will find support for Internet Explorer in this forum: http://answers.microsoft.com/en-us/ie

  • When I use Windows Maovie Maker, the program keeps freezing upwards and says that it does not.

    When I use Windows Maovie Maker, the program keeps freezing upwards and says that it does not. I close and try again, but get the same question. in the past, I used this program very well without any problem. Now I do one or two things in the tyring program to create a video and it freezes. Any suggestions how I can fix this problem?

    The three main causes of problems of Movie Maker are:

    (1) incompatible or damaged source files.
    (Photos / videos / Audio clips)

    Several formats are apparently compatible with
    Movie Maker, but the most reliable choices are:

    Photos - bmp
    Video - wmv or dv - avi
    Audio - wav, wma, wmv

    (2) problems with video filters

    Open Movie Maker and go... Tools / Options /.
    Compatibility tab and disable all filters / OK.

    If this does not help, try going back to the same
    location and on the left, click on the 'all the default settings.
    button. / OK.

    (3) too large or complex project

    Create small projects.
    Add less Transitions, effects, etc...

  • Remove the file name characters when exporting to file

    Hi all

    I worked with Silly-V , which has been extremely useful in creating a script to automate creating files in Illustrator.

    What I need help with now is the ability to add in this script, the ability to remove "x #" character of a filename on export. This would be ideal, as it will completely automate what I did by hand for months.

    The current script, that we have put in place takes generally, which would take me about 1 minute per file and it has reduced to 10 seconds. Translate this in the whole of the need to treat roughly 800-1 000 files, and you can see where the time invested is decreased significantly.

    The last piece of the puzzle is the removal of characters from ONE of the two files that are created through this script.

    First of all, this is the current script. It seems to work perfectly for what I ask it to do.

    #target illustrator-19  
    function test(){  
      
      
      var folder_1 = Folder("~/Desktop/Header CAD");  
      var folder_2 = Folder("~/Desktop/Clean CAD");  
        
      app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;  
        
      function revealAllLayers(doc) {    
          for (var i = doc.layers.length - 1; i >= 0; i--) {    
              doc.layers[i].visible = true;    
          }    
      };    
      
      
      
      
      function hideLayer(doc, name) {    
          doc.layers.getByName(name).visible = false;    
      };    
      
      
      
      
      function exportMyPng(dest, doc, props) {    
          if(props.hasOwnProperty("antiAliasing")){    
            switch(props.antiAliasing){    
              case "ARTOPTIMIZED" : {    
                  app.preferences.setIntegerPreference("plugin/PNGFileFormat/AntiAlias", 1);    
                  break;      
              }    
              default : {    
                  break;    
              }    
            }    
          }    
          var pngOpts = new ImageCaptureOptions();   
          pngOpts.antiAliasing = true;   
          for (var all in props) {    
              if (pngOpts.hasOwnProperty(all) && all != "antiAliasing") {    
                  pngOpts[all] = props[all];    
              }    
          }    
          doc.imageCapture(File(dest + "/" + doc.name.replace(/\.\w+$/, props.extraStuff + ".png")), doc.visibleBounds, pngOpts);    
      };    
      
      
      
      
      var doc = app.activeDocument;    
      revealAllLayers(doc);    
      hideLayer(doc, "Materials");    
      hideLayer(doc, "Detail Artwork");    
      exportMyPng(folder_1, doc, {    
          transparency: false,    
          antiAliasing: "ARTOPTIMIZED",    
          resolution: 300,    
          extraStuff: "_header"
      });    
      
      
    
    
        
      hideLayer(doc, "Header");    
      exportMyPng(folder_2, doc, {    
          transparency: false,    
          antiAliasing: "ARTOPTIMIZED",    
          resolution: 300,    
          extraStuff: ""
      });    
      
      
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);  
      
      
    };       
    test(); 
    
    test(); 
    

    I found the program Name Mangler done an exceptional job of the completion of the task of renaming. Here's a screenshot of what I'm asking for looks like with this program.

    Screen Shot 2016-08-01 at 3.18.45 PM.png

    My ultimate goal is to be able to integrate this unique Name Mangler feature the existing script I posted above. Now, the problem is that I need ONLY to assign the file created by the section of the lines 66-71. As you can see, I need to remove the file name starting at the index of 14 characters.

    Is it possible and something that anyone can help with?

    Thank you in advance!

    Brooks

    Whew busy days!

    Well, I got this here:

    #target illustrator
    function test(){   
    
      var folder_1 = Folder("~/Desktop/Header CAD");
      var folder_2 = Folder("~/Desktop/Clean CAD");   
    
      app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;   
    
      function revealAllLayers(doc) {
          for (var i = doc.layers.length - 1; i >= 0; i--) {
              doc.layers[i].visible = true;
          }
      };     
    
      function hideLayer(doc, name) {
          doc.layers.getByName(name).visible = false;
      };     
    
      function exportMyPng(dest, doc, props) {
          if(props.hasOwnProperty("antiAliasing")){
            switch(props.antiAliasing){
              case "ARTOPTIMIZED" : {
                  app.preferences.setIntegerPreference("plugin/PNGFileFormat/AntiAlias", 1);
                  break;
              }
              default : {
                  break;
              }
            }
          }
          var pngOpts = new ImageCaptureOptions();
          pngOpts.antiAliasing = true;
          for (var all in props) {
              if (pngOpts.hasOwnProperty(all) && all != "antiAliasing") {
                  pngOpts[all] = props[all];
              }
          }
          doc.imageCapture(File(dest + "/" + doc.name.replace(/\.\w+$/, props.extraStuff + ".png").substr(props.charsOffStart)), doc.visibleBounds, pngOpts);
      };     
    
      var doc = app.activeDocument;
      revealAllLayers(doc);
      hideLayer(doc, "Materials");
      hideLayer(doc, "Detail Artwork");
      exportMyPng(folder_1, doc, {
          transparency: false,
          antiAliasing: "ARTOPTIMIZED",
          resolution: 300,
          extraStuff: "_header",
          charsOffStart: 0
      });     
    
      hideLayer(doc, "Header");
      exportMyPng(folder_2, doc, {
          transparency: false,
          antiAliasing: "ARTOPTIMIZED",
          resolution: 300,
          extraStuff: "",
          charsOffStart: 14
      });
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   
    
    };
    test();
    

    This one has a new parameter "charsOffStart" that you have to stick in your two-functions for the economy, and it will be lop however much from character now!

  • text appear not to when you use a link to the Web site

    Hey there who began to read.

    This question has noticed on various Web sites, I did with muse. When I use a link to the text of the Web site (e.g. facebook or other) is not displayed. I don't have the question within the site only from external sites. http://www.rikbeuselinck.be/Galleria-360-Firenze.html

    Is it possible that typekit fonts are does not load properly? It's really annoying and I don't know if other people have the same problems with my sites.

    Thanks for the reply

    What you are probably having is a bug with Chrome 33. See this thread - http://forums.adobe.com/message/6157419.

    We also have a work around for this - http://muse.adobe.com/exchange-library/chrome-33-webfont-workaround-1

    Thank you

    Sanjit

  • Adobe PDF printer crashes when you paste into the file name field

    Hello, first off there is no similar problem with all freeware pdf printers so I want to remove my config system as being the culprit. This only happens in Adobe PDF format.

    How to reproduce the problem? Have something in your Clipboard and try to paste it into the file name field when you print the file in pdf format - you should have now crashed everything that you were trying to print and the program behind it.

    Please make a fix for this, it is ridiculous that I have to install a second, freeware, pdf printer because thousand dollar software does not work properly. And I've lost tons of recipes and work this way.

    Solution is not to copy and paste into the save box.

    I found that this happens in programs other than Thunderbird and the reason why the freeware application works is that you paste into the window of the application instead of Windows' save box.

  • Can I import words from the file name as keywords in the metadata when you import pictures?

    Hello

    My apologies if this question has already been asked. I can't find the answer: will / Lightroom can import words filename for my photos as keywords in the metadata when you import the photos from my hard drive? And if so, how can I do this?

    I'm new to Lightroom from iPhoto. After reading several articles on the transfer of photos from iPhoto, I exported some 7000 photos in an electronic file on my hard drive. I'm following the advice, sort and rename the photo files on my hard drive to be able to import them into Lightroom in an orderly fashion. It is not too difficult because iPhoto already for most changed the filenames for event names as ordered in iPhoto. I also prefer to do it manually rather than using any iPhoto / Aperture plugin because my iPhoto organization was far from perfect and I have already started to significantly improve by changing the file names.

    I'm renaming the files of images with additional information to improve the organisation even more with what would anyway keywords "DATE/NAME/NAME OF PERSON (S) IN THE EVENT PHOTO" so it would be good to not have enter these keywords in the metadata after import for each photo. It's automatic and if not is there a way to do this? All the other tips are welcome!

    Thank you

    Hi adiscerningeye,

    You can create metadata Preset and then apply this preset on import for images.

    Link partners: -.

    Adobe Photoshop Lightroom Help | Shares of advanced metadata

    Adobe Photoshop Lightroom 4 * create and apply metadata presets

    Once you create a metadata preset, you must select it during import so it will be applied on all images when importing.

    You can also type a few words under key words, so it will work like keywords for this specific to import Images.

    Let us know if it helps.

    ~ Mohit

Maybe you are looking for