Back

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

  • You must be logged in to reply to this topic.Login

Pasteboard preferences

Return to Member Forum

  • Author
    Posts
    • #87588
      Kathy Cote
      Member

      Hello,
      Does anyone have a script to change pasteboard preferences margins ?

      Thanks for your help.

      KC

    • #87590
      Ari Singer
      Member

      To what do you want to change it?

    • #87595
      Kathy Cote
      Member

      Hi,
      I would like to change the horizontal and vertical margins pasteboard in the preferences (not the margins in the page).

    • #87680
      Ari Singer
      Member

      I understand. But to what measurements do you want to change it?

    • #87690
      Matt Isaac
      Participant
      /*
      Scripted by Skemicle
      */
      if (parseFloat(app.version) < 6)
      main();
      else
      app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Adjust Pasteboard Margins");
      function main() {
      var win = app.dialogs.add({name:"Adjust Pasteboard Margins"});
      with (win.dialogColumns.add()){
      	staticTexts.add({staticLabel:"Set pasteboard top/bottom margins to:"});
      	staticTexts.add({staticLabel:"Set pasteboard left/right margins to:"});
      }with(win.dialogColumns.add()){
      	var tbMarginField = textEditboxes.add({editContents:"1"});
      	var lrMarginField = textEditboxes.add({editContents:"5"});
      }win.show();
      var tbMargin = lrMarginField.editContents;
      var lrMargin = tbMarginField.editContents;
      app.activeDocument.pasteboardPreferences.pasteboardMargins = [tbMargin,lrMargin];
      }
      

      This script will give a UI for the user to determine top/bottom and left/right margins. Line 11 can be used as a one line piece of code replacing “tbMargin” and “lrMargin” with the desired values.
      For information on installing and using this script see https://creativepro.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php.

    • #87701
      Matt Isaac
      Participant

      /*
      Scripted by Skemicle
      */
      if (parseFloat(app.version) < 6)
      main();
      else
      app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Adjust Pasteboard Margins");
      function main() {
      var win = app.dialogs.add({name:"Adjust Pasteboard Margins"});
      with (win.dialogColumns.add()){
      staticTexts.add({staticLabel:"Set pasteboard top/bottom margins to:"});
      staticTexts.add({staticLabel:"Set pasteboard left/right margins to:"});
      }with(win.dialogColumns.add()){
      var tbMarginField = textEditboxes.add({editContents:"1"});
      var lrMarginField = textEditboxes.add({editContents:"5"});
      }if(win.show() != 1){exit()}
      var tbMargin = lrMarginField.editContents;
      var lrMargin = tbMarginField.editContents;
      app.activeDocument.pasteboardPreferences.pasteboardMargins = [tbMargin,lrMargin];
      }
      Sorry, I forgot about the option to cancel the script in the previous script. If you canceled the previous script it would still change the margins. This script has been updated so if the dialog box is canceled the margins won’t change.

    • #87750
      Kathy Cote
      Member

      Amazing ! It works very well! thanks you so much! Thanks you all!

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
Forum Ads