/*This script works with a single jpg image. it creates a document for eachhorizontal line of pixels, then expands that line to fill up an entire frame. Use this to create a cool stripe effect. Cobbled together by Chris Reilly [creilly 4T saic D0T edu] in 2007. This script is distributed under a Creative CommonsAttribution-Noncommercial-Share Alike 3.0 Licensesee http://creativecommons.org/licenses/by-nc-sa/3.0/ for details*/app.preferences.rulerUnits = Units.PIXELS;alert ("Select the source image file to generate from");var originalFilePath = File.openDialog("Select the source image file to generate from");var sourceFile = new File(originalFilePath);open (sourceFile); var filename = sourceFile.name.substr(0,(sourceFile.name.length - 4));originalFrame = app.documents.getByName(sourceFile.name);var outputFolder = new Folder();var outputFolderPath = outputFolder.selectDlg("Select the folder to save generated files");var linecount = 0for (linecount; linecount < originalFrame.height; linecount++) // this will cycle through each vertical line of pixels in the original frame file enumerated by filename = mainframecount + 1000000//linecount usually equal to 0{		originalFrame.selection.select(new Array (new Array(0,linecount),new Array(originalFrame.width,linecount), new Array(originalFrame.width,(linecount + 1)), new Array(0,(linecount + 1))));		originalFrame.selection.copy();		var output_filename = parseFloat(filename) + "_" + parseFloat(linecount) + ".jpg";		app.documents.add(originalFrame.width, originalFrame.height, 72.0, filename + "_" + linecount + ".jpg");			activeDocument.selection.select(new Array (new Array(0,0),new Array(originalFrame.width,0), new Array(originalFrame.width,1), new Array(0,1)),SelectionType.REPLACE, 0, false);	activeDocument.paste();		activeDocument.flatten();		for( var count2 = 0; count2 < 9; count2++)	{					activeDocument.selection.select(new Array (new Array(0,0),new Array(originalFrame.width,0), new Array(originalFrame.width,Math.pow(2,count2)), new Array(0,Math.pow(2,count2))),SelectionType.REPLACE, 0, false);				activeDocument.selection.copy();				activeDocument.selection.select(new Array (new Array(0,Math.pow(2,count2)),new Array(720,Math.pow(2,count2)), new Array(720,(2 * Math.pow(2,count2))), new Array(0,(2 * Math.pow(2,count2)))),SelectionType.REPLACE, 0, false);		activeDocument.paste();				activeDocument.flatten();	}		var jpegOptions = new JPEGSaveOptions();		saveDoc = app.documents.getByName(filename + "_" + linecount + ".jpg");			saveDoc.saveAs(new File(outputFolderPath + "/" + filename + "_" + linecount + ".jpg"), jpegOptions);		saveDoc.close();}activeDocument.close();