What I’m trying to do I’d be able to do if I was in Automator, but I’ve ventured outside and gotten enough snippets to put this script together:
on open these_items
activate
--Pop Box
display dialog "Converting to PDF. Please Wait." giving up after 1
repeat with this_item in these_items
tell application "Preview"
open this_item
my SaveAS_pdf(name of (info for this_item))
end tell
end repeat
end open
on SaveAS_pdf(This_name)
tell application "System Events" to tell process "Preview"
if exists window This_name then -- else is not a valid format
set frontmost to true
keystroke "s" using {command down, shift down}
tell sheet 1 of front window
keystroke (ASCII character 29) -- set insertion point to end of text
keystroke ".pdf" --set extension name in text field
tell pop up button 1 of group 1
click
click menu item "PDF" of menu 1
end tell
delay 0.3
click button "Save"
repeat until not (exists) -- wait until the sheet close
delay 0.3
end repeat
end tell
keystroke "w" using command down --close front window
end if
--Quit App
tell application "Preview" to quit
end tell
activate
--Pop Box
display dialog "Converted, Thank You." giving up after 1
end SaveAS_pdf
But what I’m looking for is afterward, throwing the forthcoming PDF files into Photoshop. I would appreciate direction as to how to accomplish this final step.
Thanks.