Name PDF as Masterpage

Dear Indesign scripting,

I use this script for a while now. Thanks to Jongware.

But is there a way I can name the PDF file under the name of the master page it uses? (As DocumentName + MasterpageNameA + MasterpageNameC.PDF)

Export only certain master pages

This is my editing of the original post above:

var mCheckbox = [];  
var expMasterDialog = app.dialogs.add({name:"Welke moeten geëxporteerd worden", canCancel:true});  
with (expMasterDialog)  
{  
with(dialogColumns.add())  
{  
  for (i=0; i<app.activeDocument.masterSpreads.length; i++)  
  {  
   with(dialogRows.add())  
   {  
    mCheckbox[i] = checkboxControls.add({staticLabel:app.activeDocument.masterSpreads[i].name,checkedState:false});  
   }  
  }  
}  
}  


if (expMasterDialog.show() == true)  
{
newRange = '';  
for (i=0; i<app.activeDocument.pages.length; i++)  
{  
  if (app.activeDocument.pages[i].appliedMaster &&  
   mCheckbox[app.activeDocument.pages[i].appliedMaster.index].checkedState == true)  
  {  
  
  var myBaseName = app.activeDocument.pages[i].appliedMaster.name; 
  
   if (newRange) newRange += ',';  
   newRange += app.activeDocument.pages[i].name;  
  }  
}  
app.pdfExportPreferences.pageRange = newRange;  
// alert (newRange);  






app.activeDocument.exportFile (ExportFormat.PDF_TYPE, File((app.activeDocument.fullName.fsName +'_'+ myBaseName +'!').replace(/(\.indd)?!$/i, '.pdf')), true, app.pdfExportPresets[0]);  
}  







Thanks for all those who want to help me.

He already done? Oh wait, I see that it only uses the first name because master page. I guess that I expected you to use it with a single master page only.

Fortunately, this is only a small change: building the myBaseName prefix before looping on the individual pages, not 'inside' this loop.

var mCheckbox = [];
var expMasterDialog = app.dialogs.add({name:"Welke moeten geëxporteerd worden", canCancel:true});
with (expMasterDialog)
{
with(dialogColumns.add())
{
  for (i=0; i

It exports a file 'export-test' as "export-test_B-Master + C - Master.pdf.

Tags: InDesign

Similar Questions

  • Bugs on iBooks - name PDF changes do not

    The problem is that the name of the PDF in iBooks did not change after that I did these two steps:

    1. change the name by pressing select and then the title of the PDF file.

    2. turn off the application iBooks multitasking (the screen after two double click the "home" button)

    3. return to the iBooks app

    After that I made these, I found that the title returned to its original name.

    PDF title would change after these three steps when I used iOS 9.2.1. It cannot operate at iOS 9.3 and 9.3.1 iOS.

    Anyone know how to fix this? Thank you.

    It will not work on my iPad and iPhone 5, always in market to iOS 9.3.1

  • PhotoShop 'Actions' and single name PDF

    Batch conversion of resizing and cropping of files PDF, Photoshop fails to appoint uniquely results with the name of the original file of documents. It replaces the output several times with the same file name. I can avoid this problem by having numbered file adobe instead. but I always lose the name of the original file. It looks like a bug.

    Even 'action' will correctly properly called JPEG & TIFF files (but not PDFs.)

    The work to seem to not use photoshop 'Actions' to PDF batch convert. use Actions that once the files have been converted to TIFF or any other format.

    You do a Save As in yourself, Action and replace this step and add something in the batch dialog box to create the name of the output file that is different from the name of document? You need to do if the file input and output files are one and same.

  • Scope of the name PDF objects

    Article 3.2.4 (page 56) of the sixth edition of Adobe PDF reference (PDF version 1.7), States:

    "A name object is a single atomic symbol defined by a sequence of characters. Unique defined means that two objects any name formed from the same sequence of characters are identically the same object. »

    Initially, I took this means that names are unique on a document, but recently discovered that this is not the case (I tried font cache that this way, but the discovered names are re-used for different fonts on different in some documents pages - the document PDF Reference above is one of them!)

    So my question is: what opportunities the uniqueness of name objects PDF have? Are they guaranteed unique per page? Is that the point specified anywhere?

    Thank you

    H

    Do not confuse the object name with the VALUE associated with a name in a dictionary.

    / Type is a name, as /F1 and foo, etc...

    However, when you have them in a dictionary, such as

    < esources="">< 1="" 1="" 0="" r="">> >>

    Then /ressources and /F1 are always names - and will always be the names.  BUT what object #1 is going to be something else (most likely a dictionary in this case).

  • Export single page PDF, with page number of name

    Not sure if this is better done in InDesign or Acrobat, I start here.

    I have a 100 page document. I need each page to a separate PDF file. However, I need the PDF files for the number of page. My page numbers for this document, begin with 3781, so the first page should be 3781.pdf (not my [document] _1.pdf)

    I think a script is the best way?

    Thank you

    Lisa

    cdflash wrote: [...]

    @ Jongware

    a script would however be AWESOME!

    Really, it is trivial. Fill out your Preset favourite in the first line and your export path in the 2nd, and you're ready to go.

    var pdfPreset = "[Press Quality]";
    var exportPath = "/c/temp";
    for (aPage=0; aPage < app.activeDocument.pages.length; aPage++)
    {
    app.pdfExportPreferences.pageRange = app.activeDocument.pages[aPage].name;
    app.activeDocument.exportFile (ExportFormat.PDF_TYPE, File(exportPath+"/"+app.activeDocument.pages[aPage].name+".pdf"), false, pdfPreset);
    }
    
  • BlackBerry Smartphones Blackberry 9000 "BOLD" PDF setting look at a problem

    I just got a Blackberry 9000 "BOLD" of brand new out of the box of the AT & T store today. When I try to open a PDF from an email on the phone, he said. "This type of attachment cannot be seen on the device.

    I don't need or want a 3rd party program PDF, just basic viewing of PDF...

    What is a cure for this? Surely, the phone doesn't work right.

    Thank you

    Here's my own weird solution that has work for me if someone else has this problem.

    Power off, power.

    I've renamed the PDF file that I have emalied me to something simple like test.pdf > as fine opend.

    Then re-sent me a longer name PDF it was initially & then which seemed to open ok.

    Now I really like my "BOLD" even better.

  • Help with a javascript - need the name of the document file name when exporting

    When I run this script:

    var myPresets = app.pdfExportPresets.everyItem () .name;

    myPresets.unshift ("- select preset-");

    var myWin = new window ("dialog", "PDF Export Presets'");

    myWin.orientation = "row";

    {with (myWin)}

    myWin.sText = Add ("' statictext ', undefined, ' select PDF Export preset :');)

    myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});)

    myWin.myPDFExport.selection = 10;

    myWin.btnOK = Add ('button', undefined, "OK");

    };

    myWin.center ();

    myWindow var = myWin.show ();

    If (myWindow == true & & myWin.myPDFExport.selection.index! = 0) {}

    var myPreset = app.pdfExportPresets.item (String (myWin.myPDFExport.selection));

    myFile = lead (File.saveDialog ("save the file with preset:" + myPreset.name, "PDF files: *.pdf"));

    If (myFile! = null) {}

    app.activeDocument.exportFile (ExportFormat.PDF_TYPE, myFile, false, myPreset);

    } else {}

    Alert ("no file selected");

    }

    } else {}

    Alert ("no predefined PDF selected");

    }

    I need to place the filname document automatically when the dialog box "Save as" appears:

    Udklip.PNG

    Can someone help me?

    Use this:

    myPath = app.activeDocument.filePath + '/' + app.activeDocument.name.replace (/\.indd$/, '.pdf');
    myFile = File(myPath).saveDlg("Save file with preset: " + myPreset.name,"PDF files: *.pdf");
    

    Peter

  • Export PDF convert Word doc

    I have a subscription to Adobe export in PDF, annual.  (It is a little confusing because when I open a PDF file, it says in the upper left corner "[document name] .pdf - Adobe Reader.")  It is in any case, not to convert my PDF to Word.  He puts a text (image) box in a Word document.  I'm used to be able to convert the docx files.  Why it is not working?

    Thank you

    Barton

    Hi bartonlew,

    Make sure you use last DC of Adobe Acrobat Reader Acrobat Reader DC Learn & support to use the service to export it to the format PDF using Acrobat Reader. Export PDF to Acrobat Reader DC.

    You can also try to use online at https://cloud.acrobat.com/exportpdf

    Let me know if it solves your problem.

    Kind regards

    Nicos

  • PDF/A with Reader and PDF with Acrobat

    Hello

    Can I tell Windows Open the PDF/A with Adobe Reader and the PDF with Adobe Acrobat.

    Thank you

    Nothing. Windows doesn't use the end of the name ("pdf") pour choose.

  • Pdf of the book export

    I'm quite new in the Java scripts and I'm working (or studying) to export a pdf to book via a script.

    I want to save the pdf file in the same way and with the same name of the books itself... is it possible?

    For what I found

    ExportFormat.pdfType,

    File (Folder.desktop + "/ site/folder/name.pdf"), it's true;

    There should be a way ti change or even ask the name and path.

    Thank you

    Try this,

    var myPDFExportPreset = app.pdfExportPresets.item("[Press Quality]");//change your pdf preset here
    app.activeBook.exportFile(ExportFormat.pdfType, new File(app.activeBook.filePath +"/" + app.activeBook.name.toString().substring(0,app.activeBook.name.toString().length-5) +".pdf"), 0, myPDFExportPreset);
    

    Vandy

  • Adobe PDF Pack - create a Table of contents in combined PDFs I create?

    Can I create a table of contents for the PDF files, I am combining in Adobe PDF Pack?

    If the answer is YES can I appoint each the name of name PDF documents I want the page named in the Table of contents?

    Thank you.

    Michael

    Hi Michael,

    When you combine files into a single PDF, every file that you include will be a bookmark in the Bookmarks panel in Acrobat/Reader. So, I guess you could treat it as a Table of contents. (It is not, however, create a table of contents separate and add it to the file.) The bookmark names will reflect the name of each file you file handset.

    I hope that answers your question.

    Best,

    Sara

  • why I can't open a downloaded .pdf file?

    When I download a PDF from the Internet and save it, the name and the file extension pdf all them seem to be in order.  However, when I try to open the file I get the following error message: "Acrobat file cannot be opened" site/folder/name.pdf "because it is not a type of file supported or because the file has been damaged."  I use Adobe Acrobat XI for Mac.


    I was able to open other pdf files that are not downloaded from the Internet without problem.


    After I download a PDF from the Internet I can't use select all to select the document to use in Pagis.


    Because I frequently need to access pdf files downloaded from the Internet, the current situation is totally unacceptable.


    Help!

    This happens usually if he was transferred incorrectly or inconsistent with the download, probably the first system. This happens with all PDFs or just a little? Have a link so that we can try? What operating system and the version of Acrobat are you using?

    With regard to the problem of download, people sometimes download a PDF as ASCII file and it's a binary file. Download ASCII corrupts the file. The first need is to see if it's a problem of downloading or something else, then the URL would be helpful.

  • Illustrator javascript save them to PDF - issue defining the values listed as a variable

    Hello


    I'm trying to figure out how I can use a variable as the target for a save as PDF option in Illustrator javascript. the work of fine variables where there is no value listed for the property that is opts.generateThumbnails but I can understand how to run opts.compatibility or other properties with the values using a variable as the definition listed.


    Example code snippet below will always give an error "The enumerated value should" during the opts.colorCompression option even if the string is correct.

    If I define chose him as opts.colCompression = compressionQuality.AUTOMATICJPEGHIGH then everythings works


    Does anyone know how I can set the compressionQuality.AUTOMATICJPEGHIGH as a variable will work


    TKS


    Code snippet


    OPTS = new PDFSaveOptions();

    OPTS.Compatibility = PDFCompatibility.ACROBAT5;

    opts.generateThumbnails = thumbnailValue;

    opts.preserveEditability = editingValue

    OPTS. Optimization = optimizationValue;

    opts.colorCompression = colCompressionDefault;


    default value is defined at the beginning of the script like: -.

    var colCompressionDefault = "compressionQuality.AUTOMATICJPEGMAXIMUM";


    Alert ("Options of Compression of color =" + opts.colorCompression);


    for (x = 0; x < doc.artboards.length; x ++)

    {


    doc.artboards.setActiveArtboardIndex (x);

    var artboardName = doc.artboards [x] .name;


    If ((artboardName.match (/ ^ imprimé / i)))

    {

    opts.artboardRange = x + 1;

    expFile = file (destFolder + "/" + "stringname" + "-" + doc.artboards [x] .name + ".pdf");

    doc.saveAs (expFile, opts);      It is the privilege which fails

    }

    }


    Close the open document

    sourceDoc.close (SaveOptions.DONOTSAVECHANGES);

    If you have information on how I should set...

    I do it, I showed you how, in my previous post, Javascript is case-sensitive,

    It does not exist

    compressionQuality.AUTOMATICJPEGMAXIMUM
    

    This is done

    CompressionQuality.AUTOMATICJPEG2000MAXIMUM
    
  • How to remove the link to the pdf of the print icon in the dashboard?

    In my environment of OBIEE the print icon doesn't have a PDF option, but there the HTML option.

    How to do?

    The same files webcat when put in a different environment has the PDF link.

    Hello
    Problem is OBIEE on your machine. Someone may have deleted pdf option.
    Reference: http://obiee101.blogspot.com/2009/07/obiee-dashboard-default-controls.html
    Try to tag that must be removed from the controlmessages.xl so that you have only HTML.

    Update:
    Stop BI Server.Try removing label and restart the server.
    (name = "enablePDF" sawm:if > (a class = "NQWMenuItem" name = "pdf" href = "javascript:void (null)" onclick = "return PortalPrint('@{pdfURL}[javaScriptString]',@{bNewWindow});" >))

    Kind regards
    Srikanth

    Published by: Srikanth masbah April 19, 2011 03:36

  • How to filter Documents attached in PDF format?

    Hello people,

    I wonder if we can restrict some documents attached to a PDF file or not. For example, I can add only Microsoft Word documents to PDF format and ignore the reset of all other documents. Please let me know how can I generate this type of functionality.

    Thanks in advance

    Rajesh

    Hi Renon,

    If you use a button for the user to add an attachment, then you can use JavaScript code like this in the event click;

    var attachmentName = "SupportDocument."

    var validTypes = 'doc, docx, xls, xlsx.

    var PDF = event.target;

    If (pdf.importDataObject (attachmentName))

    {

    attachment var = pdf.getDataObject (attachmentName);

    var attachment.path.replace = filetype (/(.*)-.) () [a-zA-Z] +) $/, « $2')

    If (validTypes.split(',').indexOf (filetype) = - 1).

    {

    pdf.removeDataObject (attachmentName);

    App.Alert ("' invalid file type");

    }

    }

    You should always check when they argue that they have not added an attachment via the builtin Adobe attachment Panel.  Something like;

    var PDF = event.target;

    If (pdf.dataObjects! == null)

    {

    for (var i = 0; i)< pdf.dataobjects.length;="">

    {

    If (pdf.dataObjects [i] .name = pdf.dataObjects [i] .path)

    {

    App.Alert ("you have an invalid attachment");

    break;

    }

    }

    }

    It is based on the property name is set to the path using the attachment Panel or the argument of the function importDataObject if using the code.  You can keep you own attachments via the script record has added that this behavior can be changed by Adobe in a future release.

    I don't want to make it sound like I know what Adobe can do, just that the name property is used to be on without a title when you use the attachment pane.

    Concerning

    Bruce

Maybe you are looking for

  • scam message to call apple support 33728 080814 - anyone else received

    A warning window of virus supposed to be from an Apple Support and give a number to ring to get rid of the supposed malware The number to call is 08081433728 Everyone received the same and apart to close the pop up is there anything else I should do?

  • All the text displays too large, Ctrl + 0 does not

    Enabled Firefox this afternoon to find all the text made too big by about 30%. Icons in the bookmarks bar and the tabs are too big, as well. If I press on Ctrl + - twice, then it seems normal, but Ctrl + 0 returned any abnormally high. Gmail in parti

  • Crashing Windows 7

    I just got a laptop Toshiba Satellite with windows 7. I went to install it, I clicked on the 64 bit OS, and it's all going well at the start of the laptop it installed the drivers, and then restarted. Then it does the same thing again and again and a

  • Satellite L500 - 152 Display driver Sims3 plus

    Hello. I use this thing = [Satellite L500-152 | http://nordic.computers.toshiba-europe.com/innovation/jsp/supportMyProduct.do?LNG=18&service=ND#tab3;] .And it was fine, until I came out and me Sims3 and Sims3 World Adventures, after installing both (

  • Need drivers for Equium L10

    I could no longer find the Cd for my Toshiba Equium L10 series card. Please, who knows where I can download the drivers for the system as a wholeThey are:Ethernet controllerMultimedia Audio ControllerModem PCIVideo controllerVideo controller (VGA COM