• 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: How can I get the count of these menu items?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get the count of these menu items?


  • Subject: Re: How can I get the count of these menu items?
  • From: Shane Stanley <email@hidden>
  • Date: Mon, 20 Jul 2015 16:34:53 +1000

On 20 Jul 2015, at 3:54 pm, Brian Christmas <email@hidden> wrote:

I’d like to get the page count of a multi-page pdf

Is there some reason you're trying to use GraphicConverter for this? Because it seems a very odd choice. And using GUI scripting for it seems crazy...

use framework "Foundation"
use framework "Quartz"

set posixPath to "/Users/shane/Desktop/Everyday AppleScriptObjC.pdf"
set anNSURL to current application's class "NSURL"'s fileURLWithPath:posixPath
set thePDFDoc to current application's PDFDocument's alloc()'s initWithURL:anNSURL
set thePageCount to thePDFDoc's pageCount()

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: How can I get the count of these menu items?
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: Objective-C Properties (was Re: AppleScriptObjC oddity)
  • Next by Date: Re: How can I get the count of these menu items?
  • Previous by thread: Re: Parsing two dates in Apple Mail for Calendar
  • Next by thread: Re: How can I get the count of these menu items?
  • Index(es):
    • Date
    • Thread