Bleed Size Variable
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Bleed Size Variable
Tagged: bleed, script, slug, text variable
- This topic has 4 replies, 2 voices, and was last updated 6 years, 4 months ago by Kirsten McMillan.
-
AuthorPosts
-
-
December 14, 2017 at 9:17 am #100333Kirsten McMillanMember
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)
} -
December 14, 2017 at 10:09 am #100334Dave WilliamsMember
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.
-
December 14, 2017 at 10:13 am #100335Kirsten McMillanMember
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) -
December 14, 2017 at 10:15 am #100336Kirsten McMillanMember
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.
-
December 14, 2017 at 3:30 pm #100343Kirsten McMillanMember
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!
-
-
AuthorPosts
- You must be logged in to reply to this topic.