Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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 );
};
Copy link to clipboard
Copied