Batch droplet: flatten, grayscale, 100dpi & vertical.

this is my first post here (and my only script that works well enough).
so, PM me if you have any troubles.

to define a printer you’ll have to change this line:

do shell script "lpr -P YOUR_PRINTER_HERE -r " & quoted form of POSIX path of tempFile

replace the YOUR_PRINTER_HERE to whatever printer you have (local or network)
to know whats your printer name for the shell you’ll need to do the following:
open Terminal (Applications->Utilities->Terminal)
and run this: “lpstat -a” without the quotes.
there you’ll see a list of all your printers, just copy and paste the name of the one you want the droplet to print to and you are done!


on open inputFiles
	--set inputFiles to (choose file with prompt "Choose files to print" with multiple selections allowed)
	
	set tempFile to (path to home folder as text) & "tempFile.pdf" --temporary file from wich to print
	
	tell application "Finder" to set sortedFiles to sort inputFiles by name --sort dropped items by name
	
	--flatten, 100dpi max, grayscale, vertical. then print.
	repeat with aFile in sortedFiles
		tell application "Adobe Photoshop CS2"
			set filePath to aFile as string
			open alias filePath
			tell current document
				if layer exists then flatten
				if (resolution > 100) then resize image resolution (100 as number)
				change mode to grayscale
				if (height < width) then rotate canvas angle 90
				save as Photoshop PDF in tempFile
				close without saving
			end tell
		end tell
		do shell script "lpr -P YOUR_PRINTER_HERE -r " & quoted form of POSIX path of tempFile
	end repeat
	
end open

thanks to everyone that helped me, i hope this is usefull to someone.