// makeGuide.jsx // Copyright 2006-2008 // Written by Jeffrey Tranberry // Photoshop for Geeks Version 2.0 /* Description: This script creates a guide */ // enable double clicking from the // Macintosh Finder or the Windows Explorer #target photoshop // Make Photoshop the frontmost application app.bringToFront(); ///////////////////////// // SETUP ///////////////////////// ///////////////////////// // MAIN ///////////////////////// // create a vertical guide 72 pixels in from the left edge makeGuide(72, "Vrtc"); ///////////////////////// // FUNCTIONS ///////////////////////// // this is a function to create a guide // Arguments: integer for pixelOffSet // and a string of either "Vrtc", "Hrzn" for orientation function makeGuide(pixelOffSet, orientation) { var id8 = charIDToTypeID( "Mk " ); var desc4 = new ActionDescriptor(); var id9 = charIDToTypeID( "Nw " ); var desc5 = new ActionDescriptor(); var id10 = charIDToTypeID( "Pstn" ); var id11 = charIDToTypeID( "#Rlt" ); desc5.putUnitDouble( id10, id11, pixelOffSet ); // integer var id12 = charIDToTypeID( "Ornt" ); var id13 = charIDToTypeID( "Ornt" ); var id14 = charIDToTypeID( orientation ); // "Vrtc", "Hrzn" desc5.putEnumerated( id12, id13, id14 ); var id15 = charIDToTypeID( "Gd " ); desc4.putObject( id9, id15, desc5 ); executeAction( id8, desc4, DialogModes.NO ); }