• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

anyone know of a script that will create interior crops?

New Here ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

anyone know of a script that will create interior crops like the attached? I have to create these many times a day manually, and a script would be a huge timesaver!

 

AI or INDD would work for me

Screenshot 2023-02-14 at 2.55.16 PM.png

TOPICS
Scripting

Views

657

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 16, 2023 Feb 16, 2023

Hi @Kev28410820xkum , try this:

 

 

app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
app.activeDocument.zeroPoint = [0, 0];
var ll = 12, //line length
    lt = 1, //line thickness
    p = app.activeWindow.activePage,
    pb = p.bounds,
    cl = makeLayer(app.activeDocument, "Crop Marks");

cl.move(LocationOptions.AT_BEGINNING);
app.activeDocument.activeLayer = cl;

//horizontal 
var myLine = makeLine(p,ll,lt,true)
myLine = makeLine(p,ll,lt,true);
myLine.move([pb[3]-ll,0]);
myLine
...

Votes

Translate

Translate
Explorer ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

Hi @Kev28410820xkum do you need this in 4 corners the page, is this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

Yep in all four corners

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

What kind of projects do you work on? The fact that either ID or AI scripting is convenient for you is the source of my questions. Is it some kind of PDF imposition and marks for some cutter? I am asking because there may be more appropriate solutions for your true needs.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

manual cutting and adding the crops internally usually means we can get an extra item on the material width.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

Yes but what about using PDF tools like PitStop to add your marks? An action list can do that in a blink with no code 😉

LoicAigon_0-1676469957162.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

Just draw it on your parent page(s)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

Hi @Kev28410820xkum , Are the crop marks there as a guide for trimming? If they are, the crops you are showing in the capture would be visible after the page is trimmed—normally they would be offset from the page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

LATEST

Hi @Kev28410820xkum , try this:

 

 

app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
app.activeDocument.zeroPoint = [0, 0];
var ll = 12, //line length
    lt = 1, //line thickness
    p = app.activeWindow.activePage,
    pb = p.bounds,
    cl = makeLayer(app.activeDocument, "Crop Marks");

cl.move(LocationOptions.AT_BEGINNING);
app.activeDocument.activeLayer = cl;

//horizontal 
var myLine = makeLine(p,ll,lt,true)
myLine = makeLine(p,ll,lt,true);
myLine.move([pb[3]-ll,0]);
myLine = makeLine(p,ll,lt,true);
myLine.move([0,pb[2]-lt]);
myLine = makeLine(p,ll,lt,true);
myLine.move([pb[3]-ll,pb[2]-lt])

//vertical 
myLine = makeLine(p,ll,lt,false)
myLine = makeLine(p,ll,lt,false)
myLine.move([pb[3]-lt,0]);
myLine = makeLine(p,ll,lt,false);
myLine.move([0,pb[2]-ll]);
myLine = makeLine(p,ll,lt,false);
myLine.move([pb[3]-lt,pb[2]-ll])

app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;

/**
* Make a graphic line 
* @ param page destination 
* @ param line length 
* @ param line thickness 
* @ param true horizontal or false vertical 
* @ return the line 
*
*/
function makeLine(p,l,t,h){
    var ln = p.graphicLines.add({strokeColor:"Black", strokeWeight:t});
    if (h) {
        ln.geometricBounds = [0,0,0,l];
        ln.strokeAlignment=StrokeAlignment.INSIDE_ALIGNMENT;
    } else {
        ln.geometricBounds = [0,0,l,0]
        ln.strokeAlignment=StrokeAlignment.OUTSIDE_ALIGNMENT;
    }
    return ln
}


/**
* Makes a new named Layer 
* @ param the document to add the layer 
* @ param layer name 
* @ return the new layer 
*/

function makeLayer(d, n){
    if (d.layers.itemByName(n).isValid) {
        return d.layers.itemByName(n);
    } else {
        return d.layers.add({name:n});
    }
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines