AppleScript名:ASOCで指定PDFのページ数をかぞえる v2 |
use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" use framework "QuartzCore" set aFile to choose file of type {"com.adobe.pdf"} set pCount to my pdfPageCount:aFile –指定PDFのページ数をかぞえる(10.9対応。普通にPDFpageから取得) –返り値:PDFファイルのページ数(整数値) on pdfPageCount:aFile set aFile to POSIX path of aFile set theURL to current application’s |NSURL|’s fileURLWithPath:aFile set aPDFdoc to current application’s PDFDocument’s alloc()’s initWithURL:theURL set aRes to aPDFdoc’s pageCount() return aRes as integer end pdfPageCount: |
More from my site
(Visited 15 times, 1 visits today)