AppleScript名:指定PDFのすべてのページからすべてのアノテーションを削除する |
— Created 2017-06-09 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "Quartz" set aHFSPath to (choose file of type {"com.adobe.pdf"} with prompt "Choose a PDF with Annotation") set aPOSIX to POSIX path of aHFSPath set aURL to (current application’s |NSURL|’s fileURLWithPath:aPOSIX) set aPDFdoc to current application’s PDFDocument’s alloc()’s initWithURL:aURL set pCount to aPDFdoc’s pageCount() repeat with ii from 0 to (pCount – 1) set firstPage to (aPDFdoc’s pageAtIndex:ii) set anoList to (firstPage’s annotations()) as list repeat with i in anoList (firstPage’s removeAnnotation:i) end repeat end repeat aPDFdoc’s writeToFile:aPOSIX |
More from my site
(Visited 40 times, 1 visits today)