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