Copy link to clipboard
Copied
Hello everyone, is it a way to delete the Registration Marks in the script menu and keep only the Crop Marks ?
Hi @Studio PAO , Are you refering to the CropMarks.jsx script that is included in the Script Panel’s Samples folder—you want this?
Scripts have to saved as plain text. Here’s a .zip file you can download:
Copy link to clipboard
Copied
Hey there,
I'm not sure I understand your question.
Do you mean deleting a script named "Registration Marks" in the Script panel? (never heard of it btw)
Right click on any script from there will allow you to delete it.
If it's not what you want to do, please provide some more information. There is no Scripts Menu (by default), no "Registration Marks" that I know of but there is one "old" Crop Marks script in the Scripts panel (Application sub-Menu).
Fred
Copy link to clipboard
Copied
Thank you for your reply, i want to know if it's possible to keep only the cropmarks menu and not the reg marks, maybe it's not possible
Copy link to clipboard
Copied
Hi @Studio PAO , Are you refering to the CropMarks.jsx script that is included in the Script Panel’s Samples folder—you want this?
Copy link to clipboard
Copied
Hi, thank you for your reply this exactly what i need !
Copy link to clipboard
Copied
This is just obtions (no Draw Marks Around)
main();
function main(){
//Make certain that user interaction (display of dialogs, etc.) is turned on.
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
if (app.documents.length != 0){
if (app.selection.length > 0){
switch(app.selection[0].constructor.name){
case "Rectangle":
case "Oval":
case "Polygon":
case "GraphicLine":
case "Group":
case "TextFrame":
case "Button":
myDisplayDialog();
break;
default:
alert("Please select a page item and try again.");
break;
}
}
else{
alert("Please select an object and try again.");
}
}
else{
alert("Please open a document, select an object, and try again.");
}
}
function myDisplayDialog(){
var myDialog = app.dialogs.add({name:"CropMarks"});
with(myDialog){
with(dialogColumns.add()){
with(borderPanels.add()){
staticTexts.add({staticLabel:"Options:"});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Length:"});
staticTexts.add({staticLabel:"Offset:"});
staticTexts.add({staticLabel:"Stroke Weight:"});
}
with (dialogColumns.add()){
var myCropMarkLengthField = measurementEditboxes.add({editValue:7, editUnits:MeasurementUnits.points});
var myCropMarkOffsetField = measurementEditboxes.add({editValue:12, editUnits:MeasurementUnits.points});
var myCropMarkWidthField = measurementEditboxes.add({editValue:1, editUnits:MeasurementUnits.points});
}
}
}
}
var myReturn = myDialog.show();
if (myReturn == true){
var myCropMarkLength = myCropMarkLengthField.editValue;
var myCropMarkOffset = myCropMarkOffsetField.editValue;
var myCropMarkWidth = myCropMarkWidthField.editValue;
myDrawPrintersMarks(true,myCropMarkLength, myCropMarkOffset, myCropMarkWidth);
myDialog.destroy();
}
else{
myDialog.destroy();
}
}
function myDrawPrintersMarks(myDoCropMarks, myCropMarkLength, myCropMarkOffset, myCropMarkWidth){
var myBounds, myX1, myY1, myX2, myY2, myObject;
var myDocument = app.activeDocument;
var myOldRulerOrigin = myDocument.viewPreferences.rulerOrigin;
myDocument.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin;
//Save the current measurement units.
var myOldXUnits = myDocument.viewPreferences.horizontalMeasurementUnits;
var myOldYUnits = myDocument.viewPreferences.verticalMeasurementUnits;
//Set the measurement units to points.
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
//Create a layer to hold the printers marks (if it does not already exist).
var myLayer = myDocument.layers.item("myCropMarks");
try{
myLayerName = myLayer.name;
}
catch (myError){
var myLayer = myDocument.layers.add({name:"myCropMarks"});
}
//Get references to the Registration color and the None swatch.
var myRegistrationColor = myDocument.colors.item("Registration");
var myNoneSwatch = myDocument.swatches.item("None");
//Process the objects in the selection.
myBounds = myDocument.selection[0].visibleBounds;
for(var myCounter = 0; myCounter < myDocument.selection.length; myCounter ++){
myObject = myDocument.selection[myCounter];
myBounds = myObject.visibleBounds;
//Set up some initial bounding box values.
if (myCounter==0){
myX1 = myBounds[1];
myY1 = myBounds[0];
myX2 = myBounds[3];
myY2 = myBounds[2];
}
if (myDoCropMarks == true){
myDrawCropMarks (myBounds[1], myBounds[0], myBounds[3], myBounds[2], myCropMarkLength, myCropMarkOffset, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
}
else{
//Compare the bounds values to the stored bounds.
//If a given bounds value is less than (for x1 and y1) or
//greater than (for x2 and y2) the stored value,
//then replace the stored value with the bounds value.
if (myBounds[0] < myY1){
myY1 = myBounds[0];
}
if (myBounds[1] < myX1){
myX1 = myBounds[1];
}
if (myBounds[2] > myY2){
myY2 = myBounds[2];
}
if (myBounds[3] > myX2){
myX2 = myBounds[3];
}
}
}
if (myDoCropMarks == true){
myDrawCropMarks (myX1, myY1, myX2, myY2, myCropMarkLength, myCropMarkOffset, myCropMarkWidth,myRegistrationColor, myNoneSwatch, myLayer);
}
myDocument.viewPreferences.rulerOrigin = myOldRulerOrigin;
//Set the measurement units back to their original state.
myDocument.viewPreferences.horizontalMeasurementUnits = myOldXUnits;
myDocument.viewPreferences.verticalMeasurementUnits = myOldYUnits;
}
function myDrawCropMarks (myX1, myY1, myX2, myY2, myCropMarkLength, myCropMarkOffset, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer){
//Upper left crop mark pair.
myDrawLine([myY1, myX1-myCropMarkOffset, myY1, myX1-(myCropMarkOffset + myCropMarkLength)], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myDrawLine([myY1-myCropMarkOffset, myX1, myY1-(myCropMarkOffset+myCropMarkLength), myX1], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
//Lower left crop mark pair.
myDrawLine([myY2, myX1-myCropMarkOffset, myY2, myX1-(myCropMarkOffset+myCropMarkLength)], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myDrawLine([myY2+myCropMarkOffset, myX1, myY2+myCropMarkOffset+myCropMarkLength, myX1], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
//Upper right crop mark pair.
myDrawLine([myY1, myX2+myCropMarkOffset, myY1, myX2+myCropMarkOffset+myCropMarkLength], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myDrawLine([myY1-myCropMarkOffset, myX2, myY1-(myCropMarkOffset+myCropMarkLength), myX2], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
//Lower left crop mark pair.
myDrawLine([myY2, myX2+myCropMarkOffset, myY2, myX2+myCropMarkOffset+myCropMarkLength], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myDrawLine([myY2+myCropMarkOffset, myX2, myY2+myCropMarkOffset+myCropMarkLength, myX2], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
}
function myDrawRegMarks (myX1, myY1, myX2, myY2, myRegMarkOffset, myRegMarkInnerRadius, myRegMarkOuterRadius, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer){
var myBounds
var myXCenter = myX1 + ((myX2 - myX1)/2);
var myYCenter = myY1 + ((myY2 - myY1)/2);
var myTargetCenter = myRegMarkOffset+(myRegMarkOuterRadius);
//Top registration target.
myBounds = [myY1-(myTargetCenter+myRegMarkInnerRadius), myXCenter-myRegMarkInnerRadius, (myY1-myTargetCenter)+myRegMarkInnerRadius, myXCenter + myRegMarkInnerRadius];
myDrawTarget(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myY1-(myTargetCenter+myRegMarkOuterRadius), myXCenter, (myY1-myTargetCenter)+myRegMarkOuterRadius, myXCenter]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myY1-myTargetCenter, myXCenter-myRegMarkOuterRadius, myY1-myTargetCenter, myXCenter+myRegMarkOuterRadius]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
//Left registration target.
myBounds = [myYCenter-myRegMarkInnerRadius, myX1-(myTargetCenter+myRegMarkInnerRadius), myYCenter+myRegMarkInnerRadius, (myX1 - myTargetCenter) + myRegMarkInnerRadius];
myDrawTarget(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myYCenter, myX1-(myTargetCenter+myRegMarkOuterRadius), myYCenter, myX1 -myRegMarkOffset]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myYCenter-myRegMarkOuterRadius, myX1-myTargetCenter, myYCenter+myRegMarkOuterRadius, myX1-myTargetCenter]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
//Bottom registration target.
myBounds = [myY2+(myTargetCenter-myRegMarkInnerRadius), myXCenter-myRegMarkInnerRadius, myY2+ myTargetCenter+myRegMarkInnerRadius, myXCenter + myRegMarkInnerRadius];
myDrawTarget(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myY2+myRegMarkOffset, myXCenter, myY2+myTargetCenter+myRegMarkOuterRadius, myXCenter]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myY2+myTargetCenter, myXCenter-myRegMarkOuterRadius, myY2 + myTargetCenter, myXCenter+myRegMarkOuterRadius]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
//Right registration target.
myBounds = [myYCenter-myRegMarkInnerRadius, myX2+(myTargetCenter-myRegMarkInnerRadius), myYCenter+myRegMarkInnerRadius, myX2 + myTargetCenter + myRegMarkInnerRadius];
myDrawTarget(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myYCenter, myX2+myRegMarkOffset, myYCenter, myX2+myTargetCenter+myRegMarkOuterRadius]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
myBounds = [myYCenter-myRegMarkOuterRadius, myX2+myTargetCenter, myYCenter+myRegMarkOuterRadius, myX2+myTargetCenter]
myDrawLine(myBounds, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
}
function myDrawLine(myBounds, myStrokeWeight, myRegistrationColor, myNoneSwatch, myLayer){
app.activeWindow.activeSpread.graphicLines.add(myLayer, undefined, undefined,{strokeWeight:myStrokeWeight, fillColor:myNoneSwatch, strokeColor:myRegistrationColor, geometricBounds:myBounds})
}
function myDrawTarget(myBounds, myStrokeWeight, myRegistrationColor, myNoneSwatch, myLayer){
app.activeWindow.activeSpread.ovals.add(myLayer, undefined, undefined, {strokeWeight:myStrokeWeight, fillColor:myNoneSwatch, strokeColor:myRegistrationColor, geometricBounds:myBounds})
}
Copy link to clipboard
Copied
Hi thank you again for your help, i've tried to copy the code in the script but doesn't work, i think that i have deleted some main lines, do you the full code to copy-paste please ?
Copy link to clipboard
Copied
Scripts have to saved as plain text. Here’s a .zip file you can download:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now