Skip to main content
InMarketing
Participant
July 15, 2014
Answered

HHow to create a keyline around the document perimeter

  • July 15, 2014
  • 1 reply
  • 699 views

Hey guys,

I am trying to create a keyline around the document instead of using the crop mark. I would like to automate this task for each documents for any size I create. Does somebody tried to set up a applescript for that?

I found a bunch of script about how to create a stroke for text frame but I don't know how to create a black stroke in the size of my artboard.... Help me please!

Thanks

This topic has been closed for replies.
Correct answer Chinnadk

Is this you asking?

var doc = app.activeDocument, pages = doc.pages,

width = doc.documentPreferences.pageWidth, height = doc.documentPreferences.pageHeight,

oldRO = doc.viewPreferences.rulerOrigin;

doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

for(var i=pages.length-1;i>=0;i--)

{

        var txfm = pages.textFrames.add();

        txfm.strokeWeight = 1;

        txfm.strokeType = "Solid";

        txfm.geometricBounds = [0,0,height,width];

    }

doc.viewPreferences.rulerOrigin = oldRO;

Regards,

Chinna

1 reply

Chinnadk
ChinnadkCorrect answer
Legend
July 16, 2014

Is this you asking?

var doc = app.activeDocument, pages = doc.pages,

width = doc.documentPreferences.pageWidth, height = doc.documentPreferences.pageHeight,

oldRO = doc.viewPreferences.rulerOrigin;

doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

for(var i=pages.length-1;i>=0;i--)

{

        var txfm = pages.textFrames.add();

        txfm.strokeWeight = 1;

        txfm.strokeType = "Solid";

        txfm.geometricBounds = [0,0,height,width];

    }

doc.viewPreferences.rulerOrigin = oldRO;

Regards,

Chinna

InMarketing
Participant
July 16, 2014

Hey Chinnadk,

It could be this. I have copied and pasted the applescript you gave me but there is an error at the first line. I don't know how to fix that. Do I also need to write this : tell application Indesign CS6?

Thanks for your help. I really appreciate.

Regards, Vincent

Larry G. Schneider
Community Expert
Community Expert
July 16, 2014

It's not an AppleScript but rather an ExtendScript (Adobe version of Java). In Adobe Utilities there should be an ExtendScript folder. Just launch the ExtendScript app, open a new file and paste in the above. Just don't include the numbers. Save as a .jsx file. You can try running it from there or place it in the Scripts folder of ID. ExtendScript is cross platform; works on both Mac and Windows.