Re: count pages in PDF on OS 10.4
Re: count pages in PDF on OS 10.4
- Subject: Re: count pages in PDF on OS 10.4
- From: Barry Wainwright <email@hidden>
- Date: Thu, 08 Jan 2009 12:24:33 +0000
Not sure how reliable it is, but this seems to work on all PDFs I have
tried it on:
on open theFiles
set fileData to read (item 1 of theFiles)
set {oldTIDS, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, {"/Type /Pages"}}
set dataChunk to last text item of fileData
set AppleScript's text item delimiters to {"/Count "}
set pageCount to first word of last text item of dataChunk
set AppleScript's text item delimiters to oldTIDS
return pageCount
end open
--
Barry
On 7 Jan 2009, at 08:26, Håvard Graudo wrote:
What is the fast and simple way to find the number of pages in PDF
files on OS 10.4?
On 10.5 I use this:
set PDFfilPosix to POSIX path of (choose file of type "com.adobe.pdf")
set antSider to last word of (do shell script "mdls -name
kMDItemNumberOfPages " & quoted form of PDFfilPosix)
Håvard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden