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

Some help needed for guides.

New Here ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

Hi,

I need this script, or another, to place guides in "dead-centre" (50%/50%)horizontal and vertical!
Since I'm a nobody in Jsx I need some help, badly!! :)
For 2 day's I've seen nothing but "errors" :(
Can somebody help me, please?

Regards
Mahon

Code: start
///////////////////////////////////////////////////////////////////////////////
// make guideline
///////////////////////////////////////////////////////////////////////////////
function guideLine(position, type) {
// types: Vrtc & Hrzn
// =======================================================
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 );

Code: End
TOPICS
Actions and scripting

Views

483

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
Explorer ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

guideLine(app.activeDocument.width.value, 'Vrtc');
guideLine(app.activeDocument.height.value, 'Horz');

-X

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 ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

Thank you -X
I tried this, but error again

guideLine(app.activeDocument.width.value=50%, 'Vrtc');
guideLine(app.activeDocument.height.value=50%, 'Horz');

Notice that I'm a 'D' blond.

Mahon

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 ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

guideLine(app.activeDocument.width.value/2, 'Vrtc');
guideLine(app.activeDocument.height.value/2, 'Horz');

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 ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

@paul-r
Thanks but .... Error 24: guideline is not a function

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 ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

guideLine is case sensitive, so guideline will not work it must be guideLine.Capitol 'L'

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 ,
Oct 03, 2008 Oct 03, 2008

Copy link to clipboard

Copied

Hi Paul-R

I've tried GuideLine; guideLine and guideline, but still
Error 24: guideLine is not a function

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 ,
Oct 03, 2008 Oct 03, 2008

Copy link to clipboard

Copied

Please try this...


var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

guideLine(app.activeDocument.width.value/2, 'Vrtc');

guideLine(app.activeDocument.height.value/2, 'Hrzn');

app.preferences.rulerUnits = strtRulerUnits;

app.preferences.typeUnits = strtTypeUnits;



function guideLine(position, type){

var desc27 = new ActionDescriptor();

var desc28 = new ActionDescriptor();

desc28.putUnitDouble( app.charIDToTypeID('Pstn'), app.charIDToTypeID('#Pxl'), position );

desc28.putEnumerated( app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID(type) );

desc27.putObject( app.charIDToTypeID('Nw '), app.charIDToTypeID('Gd '), desc28 );

executeAction( app.charIDToTypeID('Mk '), desc27, 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 ,
Oct 03, 2008 Oct 03, 2008

Copy link to clipboard

Copied

LATEST
Whow..Thank you so much 'Paul-R' for helping me out!!
This works fine, no more errors & the guides are in "dead-centre"

Thnx ;)
Mahon

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