Photoshop Grid script

Save as .jsx

// check for document
if(app.documents.length > 0){  
	// get active document
	var psDoc = app.activeDocument; 
	
	// get user input on column count
	var colWidth = parseInt( prompt("Fill in Column width", 40) );  
	 
	var docWidth = psDoc.width;  
	
	// determine number of columns
	var colCount = docWidth / colWidth; 
	
	// create vertical guidelines
	for(i = 0; i <= colCount; ++i){  
		psDoc.guides.add(Direction.VERTICAL, i * colWidth);  
	}  
	
	var docHeight = psDoc.height;

	// determine number of rows
	var rowCount = docHeight / colWidth; 
	
	// create horizontal rows
	for(i = 0; i <= rowCount; ++i){  
		psDoc.guides.add(Direction.HORIZONTAL, i * colWidth);  
	}  	
}  

Geplaatst

in

,

door

Tags:

Reacties

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *