AppleScript名:Pages書類からPDF書き出し v2 |
— Created 2017-03-28 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set tmpPath to (path to desktop) as string set aRes to exportPagesDocToPDF(tmpPath) –Pages書類からPDF書き出し on exportPagesDocToPDF(targFolderPath as string) tell application "Pages" set dCount to count every document if dCount = 0 then return false end if set aPath to file of document 1 end tell set curPath to (current application’s NSString’s stringWithString:(POSIX path of aPath))’s lastPathComponent()’s stringByDeletingPathExtension()’s stringByAppendingString:".pdf" set outPath to (targFolderPath & curPath) tell application "Pages" set anOpt to {class:export options, image quality:Best} export document 1 to file outPath as PDF with properties anOpt end tell end exportPagesDocToPDF |
More from my site
(Visited 88 times, 1 visits today)