Here is my stab at it
seems to work ok except that it only does the first page the number of pages times in stead of processing each page into a pdf
any help would be great
tia
set thepath to “Mac HD:Users:admin:Desktop: test folder:”
set chosen_file to choose file
set current_name to characters 1 thru -4 of displayed name of (get info for chosen_file) – Get the name of the PDF file
set pgCount to my [color=green]CountPDF/color
tell application “Adobe Photoshop CS”
set display dialogs to never
repeat with i from 1 to pgCount
open chosen_file as PDF with options {width:3, page:i, resolution:150, mode:RGB, constrain proportions:true} – opens the PDF as a 3" wide 150 dpi image
set docName to name of current document
set current_name to characters 1 thru -5 of docName
tell current document
[color=blue]flatten[/color]
[color=blue]save[/color] [color=blue]in[/color] (([color=green]thepath[/color] & [color=green]current_name[/color]) [color=blue]as[/color] [color=blue]file specification[/color]) [color=blue]as[/color] [color=blue]JPEG[/color] [color=blue]with options[/color] {[color=blue]quality[/color]:5} [color=blue]appending[/color] [color=blue]lowercase extension[/color] --[color=olive]saves the jpg to the temp location[/color]
(*[color=olive]resize image resolution "72" width (0.833) with constrain proportions
[/color] set gif_file to save in ((tempfiles & current_name) as file specification) as CompuServe GIF with options {colors in palette:256} appending lowercase extension --saves the gif to the temp location
*)
close saving no
end tell
end repeat
end tell
on [color=green]CountPDF/color
set x to (read chosen_file for 200)
set PDFVersion to x’s paragraph 1
if PDFVersion = “%PDF-1.3” or PDFVersion = “%PDF-1.5” or PDFVersion = “%PDF-1.4” then
set pagesFlag to "/N "
else if PDFVersion = “%PDF-1.2” then
set pagesFlag to "/Pages "
end if
set numPages to word 1 of (text ((offset of pagesFlag in x) + (pagesFlag’s length)) thru -1 of x) as integer
return numPages
end CountPDF
–this script was automatically tagged for
–color coded syntax by Script to Markup Code
–written by Jonathan Nathan