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

Add Guides automaticly

New Here ,
Aug 04, 2008 Aug 04, 2008

Copy link to clipboard

Copied

Hi,

i would like to write a script which automaticly generates 4 guides, all of them should have a displacement of 1 cm from the border, so i can be sure, that non of the information on the flyer is out of range.

I would be happy, if you could give me a hint how to..but i am not good in js.

thanks
TOPICS
Actions and scripting

Views

333

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
Adobe
Valorous Hero ,
Aug 04, 2008 Aug 04, 2008

Copy link to clipboard

Copied

This should do it.



if(documents.length >0){

var startRulerUnits = preferences.rulerUnits

preferences.rulerUnits = Units.PIXELS

var doc = activeDocument;

var res = doc.resolution;

var CM = res/2.54;

var rightguide =doc.width - CM;

var bottomguide =doc.height - CM;

var leftguide = CM;

var topguide = CM;

guideLine(topguide,"Hrzn");

guideLine(bottomguide,"Hrzn");

guideLine(rightguide,"Vrtc");

guideLine(leftguide,"Vrtc");

preferences.rulerUnits = startRulerUnits;

}

function guideLine(position, type) {

var id296 = charIDToTypeID( "Mk " );

var desc50 = new ActionDescriptor();

var id297 = charIDToTypeID( "Nw " );

var desc51 = new ActionDescriptor();

var id298 = charIDToTypeID( "Pstn" );

var id299 = charIDToTypeID( "#Pxl" );

desc51.putUnitDouble( id298, id299, position );

var id300 = charIDToTypeID( "Ornt" );

var id301 = charIDToTypeID( "Ornt" );

var id302 = charIDToTypeID( type );

desc51.putEnumerated( id300, id301, id302 );

var id303 = charIDToTypeID( "Gd " );

desc50.putObject( id297, id303, desc51 );

executeAction( id296, desc50, DialogModes.NO );

};

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 ,
Aug 05, 2008 Aug 05, 2008

Copy link to clipboard

Copied

Thank you very much for your very quick reply. If you don't object, i would like to share this script with others under your name?

Thanks a lot again, it's a very helpfull script.

http://www.imandesign.at

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 ,
Aug 05, 2008 Aug 05, 2008

Copy link to clipboard

Copied

LATEST
No problem, glad its of use to you.

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