Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 40 total)
  • Author
    Posts
  • in reply to: CS5: Place dialog defaults? #53231

    @Anne-Marie: thank you!

    @Stix: Placing page “3” is also possible. See the following code:

    //The PDF to place will be placed cropped to it's TrimBox value;
    //true until a different setting in UI is set or true until another script forces a different behaviour:
    app.pdfPlacePreferences.pdfCrop = PDFCrop.CROP_TRIM;

    //The background of the placed PDF will be set to “transparent”, set to “false” if you want the opposite.
    //true until a different setting in UI is set or true until another script forces a different behaviour:
    app.pdfPlacePreferences.transparentBackground = true;

    //The following is working only once in one placing operation and might be true for all PDFs loaded in the “place gun”:
    app.pdfPlacePreferences.pageNumber = 3;
    //After emptying the “place gun” and without starting this script again, in the next place operation pageNumber will default to “1”

    Attention:

    if there is no page 3 in your PDF, the page that will be placed is the first page of your PDF. (To my surprise) the script will give no warning or error message.
    Further: if you load several PDFs in your “place gun” and one of them does not contain a page 3, it depends on the loading order if any of the PDFs will be placed with page 3. Say, PDF 1 of 5 contains only 2 pages, then PDF 1 will trigger the default for itself and all consecutive loaded PDFs. Result: all PDFs are placed with their page 1.

    Uwe

    in reply to: PDF export problems with CS5 #56299

    @Easybourne:

    I've written a scripting solution for exporting PDFs in “foreground”. Please test it with care, no guarantee that it will work in every case. There is a very basic UI for setting up the location where to save the pdf and to name it. After that the usual PDF preset dialog of InDesign will pop up where you can do your usual stuff like setting up page ranges etc.

    A little error handling is also present, so the script will check if a given file is already present and you can decide to overwrite it or not. Further on the script errors out smoothly if you decide to overwrite a pdf and that particular pdf is already open in an pdf viewer app.

    I hope the following lines of code are not messed up by the forum software (if so I will write a follow-up or try to edit the html-code):

    //ExportPDF_in_Foreground_CS5.jsx
    //Uwe Laubender
    /**
    * @@@BUILDINFO@@@ ExportPDF_in_Foreground_CS5.jsx !Version! Thu Jul 08 2010 10:51:10 GMT+0200
    */
    //DESCRIPTION:PDF-Export in foreground (old school) for InDesign CS5 only!

    if(app.documents.length>0){
    var d=app.activeDocument;
    };
    else{
    alert(“Please open a document to execute Export to PDF. Script will be aborted.”);
    exit();
    }
    if(d.saved == false){
    alert(“Save your document first before executing Export to PDF. Script will be aborted.”);
    exit();
    };

    var pdfPath = Folder.selectDialog(“Folder to save PDF:”);
    var pdfName = d.name+”.pdf”;

    var userDefFileName = prompt(“File name:”,pdfName,undefined);

    if(userDefFileName == null){
    exit();
    };

    var pdfFullName = pdfPath+”/”+userDefFileName;

    if(File(pdfFullName).exists){
    c=confirm(“The PDF-file “+userDefFileName+” is already existing. Do you want to overwrite it?”,true,undefined);
    if (c==0){exit()};
    };
    //Error-handling if PDF file override is on and PDF is already opened in PDF reader app:
    try{
    d.exportFile(ExportFormat.PDF_TYPE,File(pdfFullName),true,undefined,undefined);
    }catch(e){
    alert(“Error: “+e.message+” (Line “+ e.line+” in script code.)”);
    exit();
    };

    Uwe

    in reply to: Rogue 'point' #56298

    @Jongware: to circumvent this foolish forum software in the case of “i plus double minus” one could write the long form i=i-1, but in other cases like blackslashes etc.pp. it would be too complicated to rewrite a orderly written script into it's forum user-friendly version.

    @David: or could you point to all problem characters and instances of character pairs that will spoil good looking code? So, hopefully, we can do a search/replace sequence to “format” code for avoiding garbage.

    Uwe

    in reply to: How can I see my Style Overrides? #56297

    Another cool script by Marc Autret showing local formatting on page:

    https://www.indiscripts.com/pos…..design-cs4

    Marc Autret: “ShowHideLocalFormatting.js is the shortest script I've ever written. It simply toggles between the normal view mode and our special “display style overrides” mode”.

    Uwe

    in reply to: CS5: Place dialog defaults? #56296

    @Roland: if you use .jsx rather than only .js you can open the script in ExtendScript Toolkit with a double click. Both extension will work with InDesign.
    Another hint: to get a tool tip when hovering above a script name shown in the script panel of InDesign, just insert a discrptive line like this:

    //DESCRIPTION:Here comes my tool tip

    Extremely useful when the script name is not self-explanatory enough or when you want to add some other useful information.

    Uwe

    in reply to: PDF export problems with CS5 #53335

    @Easybourne:

    I've written a scripting solution for exporting PDFs in “foreground”. Please test it with care, no guarantee that it will work in every case. There is a very basic UI for setting up the location where to save the pdf and to name it. After that the usual PDF preset dialog of InDesign will pop up where you can do your usual stuff like setting up page ranges etc.

    A little error handling is also present, so the script will check if a given file is already present and you can decide to overwrite it or not. Further on the script errors out smoothly if you decide to overwrite a pdf and that particular pdf is already open in an pdf viewer app.

    I hope the following lines of code are not messed up by the forum software (if so I will write a follow-up or try to edit the html-code):

    //ExportPDF_in_Foreground_CS5.jsx
    //Uwe Laubender
    /**
    * @@@BUILDINFO@@@ ExportPDF_in_Foreground_CS5.jsx !Version! Thu Jul 08 2010 10:51:10 GMT+0200
    */
    //DESCRIPTION:PDF-Export in foreground (old school) for InDesign CS5 only!

    if(app.documents.length>0){
        var d=app.activeDocument;
        };
    else{
        alert(“Please open a document to execute Export to PDF. Script will be aborted.”);
        exit();
        }
    if(d.saved == false){
        alert(“Save your document first before executing Export to PDF. Script will be aborted.”);
        exit();
        };

    var pdfPath = Folder.selectDialog(“Folder to save PDF:”);
    var pdfName = d.name+”.pdf”;

    var userDefFileName = prompt(“File name:”,pdfName,undefined);

    if(userDefFileName == null){
        exit();
        };

    var pdfFullName = pdfPath+”/”+userDefFileName;

    if(File(pdfFullName).exists){
        c=confirm(“The PDF-file “+userDefFileName+” is already existing. Do you want to overwrite it?”,true,undefined);
        if (c==0){exit()};  
        };
    //Error-handling if PDF file override is on and PDF is already opened in PDF reader app:
    try{
    d.exportFile(ExportFormat.PDF_TYPE,File(pdfFullName),true,undefined,undefined);
    }catch(e){
        alert(“Error: “+e.message+” (Line “+ e.line+” in script code.)”);
        exit();
        };

    Uwe

    in reply to: Rogue ‘point’ #53324

    @Jongware: to circumvent this foolish forum software in the case of “i plus double minus” one could write the long form i=i-1, but in other cases like blackslashes etc.pp. it would be too complicated to rewrite a orderly written script into it's forum user-friendly version.

    @David: or could you point to all problem characters and instances of character pairs that will spoil good looking code? So, hopefully, we can do a search/replace sequence to “format” code for avoiding garbage.

    Uwe

    in reply to: How can I see my Style Overrides? #53361

    Another cool script by Marc Autret showing local formatting on page:

    https://www.indiscripts.com/pos…..design-cs4

    Marc Autret: “ShowHideLocalFormatting.js is the shortest script I've ever written. It simply toggles between the normal view mode and our special “display style overrides” mode”.

    Uwe

    in reply to: CS5: Place dialog defaults? #53228

    @Roland: if you use .jsx rather than only .js you can open the script in ExtendScript Toolkit with a double click. Both extension will work with InDesign.
    Another hint: to get a tool tip when hovering above a script name shown in the script panel of InDesign, just insert a discrptive line like this:

    //DESCRIPTION:Here comes my tool tip

    Extremely useful when the script name is not self-explanatory enough or when you want to add some other useful information.

    Uwe

    in reply to: double click interface to Open gone in CS5? #56244

    David Blatner said: I've never heard of that, and it does not work in my copy of InDesign CS4 (mac).


    It's working (!) in my copy of InDesign CS4 6.0.5 (Mac OS X 10.5.8) somehow…
    Hard to describe… Say, the tools palette is a one column one, in clicking the gray area once it will expand to a two column palette, double clicking again at the extremly right area of gray the palette will default to one column and simultaniously the open dialog will pop up…

    in reply to: double click interface to Open gone in CS5? #53306

    David Blatner said: I've never heard of that, and it does not work in my copy of InDesign CS4 (mac).


    It's working (!) in my copy of InDesign CS4 6.0.5 (Mac OS X 10.5.8) somehow…
    Hard to describe… Say, the tools palette is a one column one, in clicking the gray area once it will expand to a two column palette, double clicking again at the extremly right area of gray the palette will default to one column and simultaniously the open dialog will pop up…

    in reply to: CS5: Place dialog defaults? #56226

    Stix Hart said:This is annoying me too so I was glad to see this post, bit of a pity the fix isn't a bit more permanent. I want to crop to the the crop box though, and if I change MEDIA to CROP the script doesn't work… Any tips?


    Try PDFCrop.CROP_PDF. There are of course several other options. Here at a glance:

    PDFCrop.CROP_MEDIA //PDF MediaBox
    PDFCrop.CROP_BLEED //PDF BleedBox
    PDFCrop.CROP_TRIM //PDF TrimBox
    PDFCrop.CROP_PDF //PDF CropBox
    PDFCrop.CROP_ART //PDF ArtBox

    PDFCrop.CROP_CONTENT_ALL_LAYERS
    PDFCrop.CROP_CONTENT_VISIBLE_LAYERS

    @Roland: did the one liner remedy your pdf import problem with the office pdfs?

    Uwe

    in reply to: CS5: Place dialog defaults? #53225

    Stix Hart said:This is annoying me too so I was glad to see this post, bit of a pity the fix isn't a bit more permanent.  I want to crop to the the crop box though, and if I change MEDIA to CROP the script doesn't work… Any tips?


    Try PDFCrop.CROP_PDF. There are of course several other options. Here at a glance:

    PDFCrop.CROP_MEDIA   //PDF MediaBox
    PDFCrop.CROP_BLEED   //PDF BleedBox
    PDFCrop.CROP_TRIM   //PDF TrimBox
    PDFCrop.CROP_PDF   //PDF CropBox
    PDFCrop.CROP_ART   //PDF ArtBox

    PDFCrop.CROP_CONTENT_ALL_LAYERS
    PDFCrop.CROP_CONTENT_VISIBLE_LAYERS

    @Roland: did the one liner remedy your pdf import problem with the office pdfs?

    Uwe

    in reply to: CS5: Place dialog defaults? #56175

    [OT]
    @Jongware:
    I tried the the HTML button “Edit HTML Source” and simply inserted < code >< / code > surrounded by <p></p> tags. Surprisingly the Select Code button was a side effect. Just gave it a try. I recalled reading about it at selfhtml.org the source for (X)HTML and related topics in German and French.

    Edit: if you simply write the correct syntax for the code tag (without the intentionally set blanks) you will get immediately Select Code button plus the code field…

    @Roland:
    Where did you get the class name “sfcode”? Is there a documentation somewhere? Or were you looking that up in a browser add-on like Firebug?

    in reply to: CS5: Place dialog defaults? #53222

    [OT]
    @Jongware:
    I tried the the HTML button “Edit HTML Source” and simply inserted < code >< / code > surrounded by <p></p> tags. Surprisingly the Select Code button was a side effect. Just gave it a try. I recalled reading about it at selfhtml.org the source for (X)HTML and related topics in German and French.

    Edit: if you simply write the correct syntax for the code tag (without the intentionally set blanks) you will get immediately Select Code button plus the code field…

    @Roland:
    Where did you get the class name “sfcode”? Is there a documentation somewhere? Or were you looking that up in a browser add-on like Firebug?

Viewing 15 posts - 16 through 30 (of 40 total)