• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: count pages in PDF on OS 10.4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: count pages in PDF on OS 10.4
      • From: Håvard Graudo <email@hidden>
    • Re: count pages in PDF on OS 10.4
      • From: Jeremy Reichman <email@hidden>
References: 
 >count pages in PDF on OS 10.4 (From: Håvard Graudo <email@hidden>)

  • Prev by Date: Re: Excel 2008 - 'Autofit' broken?
  • Next by Date: Re: count pages in PDF on OS 10.4
  • Previous by thread: Re: count pages in PDF on OS 10.4
  • Next by thread: Re: count pages in PDF on OS 10.4
  • Index(es):
    • Date
    • Thread