Return to Snippet

Revision: 31415
at June 11, 2011 07:07 by landock


Updated Code
/*  
@@@BUILDINFO@@@ "removeBorder.jsx" 1.0.0 5-6-2010
*/

var myDocument = app.documents.item(0);

main();
function main(){
	if(app.documents.length != 0){
		if(app.documents.item(0).rectangles.length != 0){
			removeBorder();
		}
		else{
			alert("Document contains no graphics.");
		}
	}
	else{
		alert("Please open a document and try again.");
	}
}

function removeBorder(){	
	var myBoxes = myDocument.rectangles;
	var myText = myDocument.textFrames;
	for(var i = myBoxes.length-1; i >= 0; i--){	
		myBoxes.item(i).strokeWeight = 0;
		//this crazy number below really just means Center Content
		myBoxes.item(i).fit(1667591779);

	}
	for(var i = myText.length-1; i >= 0; i--){
		myText.item(i).strokeWeight = 0;
		}
}

Revision: 31414
at September 4, 2010 07:54 by landock


Initial Code
/*  
@@@BUILDINFO@@@ "removeBorder.jsx" 1.0.0 5-6-2010
*/

var myDocument = app.documents.item(0);

main();

function main(){
	if(app.documents.length != 0){
		if(app.documents.item(0).rectangles.length != 0){
			removeBorder();
		}
		else{
			alert("Document contains no graphics.");
		}
	}
	else{
		alert("Please open a document and try again.");
	}
}

function removeBorder(){	
	var myBoxes = myDocument.rectangles;
	var myText = myDocument.textFrames;
	for(var i = myBoxes.length-1; i >= 0; i--){	
		myBoxes.item(i).strokeWeight = 0;
		//this crazy number below really just means Center Content
		myBoxes.item(i).fit(1667591779);

	}
	for(var i = myText.length-1; i >= 0; i--){
		myText.item(i).strokeWeight = 0;
		}
}

Initial URL

                                

Initial Description

                                

Initial Title
remove border and center docs

Initial Tags

                                

Initial Language
JavaScript