At 9:14 am +0100 22/3/07, Dominic Dunlop wrote:
...For some reason, Preview is not scriptable (shame, Apple, shame),
and nor is Adobe Reader.) You can even combine AppleScript and Perl
with, for example, Mac::AppleScript or Mac::Glue.
If all that's needed is to copy the whole text of a pdf window and
put it in a text file, then GUI scripting can be used.
tell application "System Events"
tell process "Preview"
set frontmost to true
keystroke "a" using command down
delay 1
keystroke "c" using command down
end tell
end tell
set _text to the clipboard
do shell script "cd; pbpaste > trash.txt; open -a bbedit trash.txt"
JD