G’day Shane
Yeah, it’s real crazy!
I’m responding to a post on the Yahoo GraphicConverter site were a user has scanned a 200 page document as a pdf, and wants to use the GC De-speckle filter on every page, and save it.
There’s no direct command, so I wrote a GUI script to do the job, but found that GC’s page count option does not work with pdf’s, only returns a ‘1’.
ATM, my script requires the user to manually alter the script to reflect the page count.
So, out of interest, I'm looking for a way of obtaining the page count of a GraphicConverter pdf, using vanilla Applescript.
Regards
Santa
On 20 Jul 2015, at 4:34 pm, Shane Stanley < email@hidden> wrote: 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()
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
|