• 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: PDF Search
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDF Search


  • Subject: Re: PDF Search
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 28 Oct 2015 09:49:38 +0100

If you use Yosemite or El Capitan, you may use this handler borrowed to Shane Stanley.


use AppleScript version "2.4"
use framework "Foundation"
use framework "Quartz"
use scripting additions
on getTextFromPDF:posixPath
set theURL to current application's class "NSURL"'s fileURLWithPath:posixPath
set thePDF to current application's PDFDocument's alloc()'s initWithURL:theURL
return (thePDF's |string|()) as text
end getTextFromPDF:

#=====

on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe

#=====


its getTextFromPDF:(POSIX path of (choose file of type {"pdf"}))

my decoupe(result, "character")
set nbOccurences to (count result) - 1

Yvan KOENIG (VALLAURIS, France) mercredi 28 octobre 2015 09:49:28



 _______________________________________________
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: PDF Search
      • From: Takaaki Naganoya <email@hidden>
  • Prev by Date: Re: sqlite question
  • Next by Date: Re: PDF Search
  • Previous by thread: Re: PDF Search
  • Next by thread: Re: PDF Search
  • Index(es):
    • Date
    • Thread