Could sanyone help with this script to batch convert pages files to pdf?
I found this from the Google AI, but Automator returned an error. MBP running macOS Version 15.6.1 (24G90).
Please see below:
on run {input, parameters}
repeat with aFile in input
tell application "Finder"
set {tName, fileExt} to {name, name extension} of aFile
if fileExt is "pages" then
set out_file to (text 1 thru -((count of fileExt) + 2) of tName) & ".pdf"
set theFolder to (get container of aFile)
set outPath to (theFolder as text) & out_file
tell application "Pages"
set mydoc to open aFile
export mydoc to file outPath as PDF
close mydoc saving no
end tell
end if
end tell
end repeat
return input
end run
The action "Run AppleScript"
encountered an error: "The
operation couldn't be completed.
(com.apple.Automator error
-212.)"
Thanks in advance
pqb
MacBook Pro 13″, macOS 15.6