I'm trying to find a script that will allow me to add Guides to a Canvas... This would be used on a variety of canvases, so the script would need to read the canvas/image size and either add Guides to all 4 sides and then expand the canvas by .5 inch in all directions... or place them on a canvas .5" from the edge on all sides... I found one that @paul_Riggott wrote several years ago... but I'm still new and not understanding everything it's doing and how to adjust... I've also tested it on different size images and it doesn't seem to read the size of the document before proceeding... Any help is greatly appreciated... 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 ); };
... View more