MACSCRPT Archives

September 2015

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Cleveland <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 1 Sep 2015 15:09:06 -0700
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (1383 bytes) , signature.asc (505 bytes)
> On Sep 1, 2015, at 1:50 PM, SUBSCRIBE MACSCRPT Inyo55 <[log in to unmask]> wrote:
> 
> How do I make use of the stdout in Applescript?  Is it a scriptable object, or variable?

Hi Bob,

In the command line world, Standard Output (stdout) is one of three data streams, the other two being Standard In (stdin) and Standard Error (stderr). Unless they’re redirected, stdin is accepted from the keyboard and stdout and stderr are sent to the display screen. One may indeed redirect stdout to memory for further processing or writing to a file. However, as Bill pointed out, it’s simplest to just use the optional PDFTOTEXT "text-file" parameter.

The SYNOPSIS from the PDFTOTEXT man page shows the basic structure of the command:
	pdftotext [options] [PDF-file [text-file]]

For those unfamiliar with shell commands, the four parts shown above are used to specify:
1. The command itself, “pdftotext”.
2. Any optional parameters desired, such as first and last pages from which to extract — “pdftotext -f 5 -l 8” would do pages 5, 6, 7, and 8.
3. The POSIX path to the PDF file to be read.
4. The POSIX path to the text file to create (if needed) and to write the extracted text.

The square brackets in the SYNOPSIS above indicate parameters, or groups of parameters, that are optional.

HTH,
Stan C.



ATOM RSS1 RSS2