Trying to change 2 things in this script..

Hello,
I want to change two things in this script…
One is just not working and the other I don’t know how to do and was looking for guidance.

1-I want to resize the document (PDF file) once it opens to 210 pixels or 3 inches wide letting it reduce the height in proportion, but here is where the script dies.
2-Rather than choose a folder, I would rather be able to pick individual PDFs from a folder where they will get dumped. More than one at time if possible…

here is the script below…any help is appreciated.

set inputFolder to choose folder
set PDFJPG to choose folder with prompt "Please choose where you'd like your new JPG file to be saved to."
tell application "Finder"
	set filesList to files in inputFolder
end tell
repeat with aFile in filesList
	tell application "Finder"
		set theFile to aFile as alias
		set theFileName to name of theFile
	end tell
	tell application "Adobe Photoshop CS3"
		activate
		set display dialogs to never
		open theFile as PDF with options ¬
			{class:PDF open options, mode:RGB, resolution:72, use antialias:true, constrain proportions:true}
		set docRef to the current document
		set docHeight to height of docRef
		set docWidth to width of docRef
		set docName to name of docRef
		set docBaseName to getBaseName(docName) of me
		set newFile1 to (PDFJPG as string) & docBaseName
		tell docRef
			resize image current document width 210 resample method bicubic
			save docRef in file newFile1 as JPEG with options ¬
				{embed color profile:false, format options:standard, quality:9} appending lowercase extension with copying
			close docRef without saving
		end tell
	end tell
end repeat
on getBaseName(fName)
	set baseName to fName
	repeat with idx from 1 to (length of fName)
		if (item idx of fName = ".") then
			set baseName to (items 1 thru (idx - 1) of fName) as string
			exit repeat
		end if
	end repeat
	return baseName
end getBaseName

Hi,

try this


set filesList to choose file with prompt "Please choose one or multiple PDF files" with multiple selections allowed
set PDFJPG to choose folder with prompt "Please choose where you'd like your new JPG file to be saved to."
activate application "Adobe Photoshop CS3"
repeat with theFile in filesList
	set {name:fileName, name extension:fileExt} to info for theFile
	if fileExt is missing value then set fileExt to ""
	if fileExt is not "" then set fileName to text 1 thru ((count fileName) - (count fileExt) - 1) of fileName
	tell application "Adobe Photoshop CS3"
		set display dialogs to never
		open theFile as PDF with options ¬
			{class:PDF open options, mode:RGB, resolution:72, use antialias:true, constrain proportions:true}
		set docRef to the current document
		set {height:docHeight, width:docWidth, name:docName} to docRef
		set newFile1 to (PDFJPG as text) & fileName & ".jpg"
		tell docRef to resize image width 210 resample method bicubic
		save docRef in file newFile1 as JPEG with options ¬
			{embed color profile:false, format options:standard, quality:9} with copying
		close docRef without saving
	end tell
end repeat

Perfect…
I just got back to my desk and tried it, and its so funny, it was taking forever, and that is cause I assumed it defaulted to pixels, but instead it was inches… :wink:
who needs a 210 inch file…LOL
switched it to 3 inches and it was awesome…
:):lol:
thanks,