Re: Reading a pdf text file
Re: Reading a pdf text file
- Subject: Re: Reading a pdf text file
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 09 Jan 2005 09:40:10 -0800
Title: Re: Reading a pdf text file
On 1/9/05 7:44 AM, "Richard Smykla" <email@hidden> wrote:
After installing the xpdf-tools package, the command-line tool pdftotext can be found in the /sw/bin/ directory. (At least that is where it installed by default on my machine.) You can then use a simple Applescript 'do script' command to create a text version of your pdf. It will be located in the same folder as your original source pdf if all goes well, and if the source pdf file is not protected:
set response to POSIX path of ((choose file) as alias)
tell application "Terminal"
activate
set commando to "/sw/bin/pdftotext -layout " & quoted form of response
do shell script commando
end tell
That looks very good, but why are you doing it in the Terminal? You're not actually using 'do script' there, you're using 'do shell script'. If that works at all (which is great if it does), surely it would work without the Terminal:
set response to POSIX path of (choose file) -- it already is an alias
set commando to "/sw/bin/pdftotext -layout " & quoted form of response
do shell script commando
which would be even neater, and you could do it all in one line if you preferred:
do shell script ("/sw/bin/pdftotext -layout " & quoted form of POSIX path of (choose file))
A request:
Please do not BCC the mailing list - make it the To or at least the CC recipient. You make it very difficult to reply to your message to the list, not to mention messing up filtering your message where filters are based on the list as recipient. Thanks.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden