Automator & Preview: duplicate open file to specific folder
Dear all,
I'm starting to get into using the automator to build quick tasks. I thought about the following: In Preview, I have a pdf file open. I want to duplicate this pdf file and save it to a specific path on disc. The following code snippet is more or less the idea, however, doesn't work.
Any help would be highly appreciated.
Best,
Sebastian
on run {input, parameters}
tell application "Preview" to ¬
set pdfDoc to (path of front document)
tell application "Finder" to duplicate pdfDoc to "path_to_folder" with replacing
end run
MacBook Pro 13″, macOS 12.2