Bleed Size Variable

Viewing 4 reply threads
  • Author
    Posts
    • #100333

      Can anyone help me with the last line of this script? I need the ‘Bleed’ Text Variable to update with the current bleed size of the document and if none show either 0 or None.
      Thanks in advance.

      var doc = app.activeDocument;
      doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;
      doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;
      for(var i =0;i<doc.pages.length;i++)
      {
      pagesize = app.activeDocument.textVariables.itemByName(“PageSize”);
      pagesize.variableOptions.contents = doc.pages[i].bounds[3] + “w x ” + doc.pages[i].bounds[2] + “h”
      }
      {
      pagesize = app.activeDocument.textVariables.itemByName(“Intent”);
      pagesize.variableOptions.contents = “Print // CMYK // 300dpi”
      }
      {
      pagesize = app.activeDocument.textVariables.itemByName(“Process”);
      pagesize.variableOptions.contents = “4/4 // 4/0 // Spot”
      }
      {
      pagesize = app.activeDocument.textVariables.itemByName(“Profile”);
      pagesize.variableOptions.contents = (doc.cmykProfile)
      }
      {
      pagesize = app.activeDocument.textVariables.itemByName(“Fold”);
      pagesize.variableOptions.contents = “Size // Type // None”
      }
      {
      pagesize = app.activeDocument.textVariables.itemByName(“Bleed”);
      pagesize.variableOptions.contents = (app.activeDocument.documentPreferences.documentBleedUniformSize)
      }

    • #100334

      The bleed is only for when the page is trimmed down so you can have edge to edge printing. As long as you have a bleed of about 3mm it won’t matter.

    • #100335

      With Line 27 like below:
      {
      pagesize = app.activeDocument.textVariables.itemByName(“Bleed”);
      pagesize.variableOptions.contents = (app.activeDocument.documentPreferences.documentBleedBottomOffset)
      }

      I get:
      Javascript Error!
      Error Number: 30477
      Error String: Invalid value for set property ‘contents’. Expected String or SpecialCharacters enumerator, but received 0.125.

      Line: 27
      Source: pagesize.variableOptions.contents = (app.activeDocument.documentPreferences.documentBleedBottomOffset)

    • #100336

      This is going in a slug, I want the Bleed Size Variable to update when the script is run. It’s not always going to be .125in, sometimes it is .25in for larger print pieces.

    • #100343

      Thanks to Trevor in the Adobe forums

      You are passing a number in line 27, presumably
      pagesize.variableOptions.contents = (app.activeDocument.documentPreferences.documentBleedBottomOffset)

      you need to pass a string so use

      pagesize.variableOptions.contents = (” + app.activeDocument.documentPreferences.documentBleedBottomOffset)

      This solved it!

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
>