Re: Applescripts for Acrobat 6.0
Re: Applescripts for Acrobat 6.0
- Subject: Re: Applescripts for Acrobat 6.0
- From: Nigel Smith <email@hidden>
- Date: Wed, 12 Nov 2003 12:57:02 +0000
On 11/11/03 13:09, "Buttery, Ian" <email@hidden> wrote:
>
Has anyone managed to script batch conversion of PDF files to XML
>
through Acrobat. Is this possible with Applescript or would I need
>
to use a DoScript command with JavaScript?
There doesn't seem a way to directly convert or to trigger a batch-script
conversion from AppleScript.
You can do it with the "do script" command. To export the only document open
to the top level of your HD as testDoc.xml:
tell application "Acrobat 6.0 Professional"
do script <line-break>
"app.activeDocs[0].saveAs(\"/testDoc.xml\",\"com.adobe.acrobat.xml-1-00\")"
end tell
You can obviously get fancier by concating AS variables into the JavaScript
string, iterating through the active documents in JavaScript, and so on. But
see the thread "Acrobat 6 'do script' problem" before you start passing
POSIX paths through to your JavaScripts...
HTH,
Nigel
Return-path: <email@hidden>
Envelope-to: email@hidden
Delivery-date: Tue, 11 Nov 2003 18:19:04 +0000
Received: from gold.csi.cam.ac.uk ([131.111.8.12]) by
orange.csi.cam.ac.uk with esmtp (Exim 4.12) id 1AJd6W-0005xI-00 for
email@hidden; Tue, 11 Nov 2003 18:19:04 +0000
Received: from [17.254.0.151] (helo=lists.apple.com) by
gold.csi.cam.ac.uk with esmtp (Exim 4.20) id 1AJd6H-0007qI-Vu for
email@hidden; Tue, 11 Nov 2003 18:18:50 +0000
Received: from lists.apple.com (localhost [127.0.0.1]) by
lists.apple.com (8.12.9/8.12.9) with ESMTP id hABICUu6007836; Tue, 11
Nov 2003 10:12:30 -0800 (PST)
Received: from red.csi.cam.ac.uk (red.csi.cam.ac.uk [131.111.8.70]) by
lists.apple.com (8.12.9/8.12.9) with ESMTP id hABHqqnQ005037 for
<email@hidden>; Tue, 11 Nov 2003 09:52:52 -0800
(PST)
Received: from luggage.welc.cam.ac.uk ([131.111.45.207]) by
red.csi.cam.ac.uk with esmtp (Exim 4.12) id 1AJchi-0005JI-00 for
email@hidden; Tue, 11 Nov 2003 17:53:26 +0000
User-Agent: Microsoft-Entourage/10.1.1.2418
Date: Tue, 11 Nov 2003 17:53:22 +0000
Subject: Acrobat 6 "do script" problem...
From: Nigel Smith <email@hidden>
To: Applescript Users List <email@hidden>
Message-ID: <
BBD6D292.F44D%email@hidden>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Sender: email@hidden
Errors-To: email@hidden
X-BeenThere: email@hidden
X-Mailman-Version: 2.0.13
Precedence: bulk
List-Unsubscribe: <
http://www.lists.apple.com/mailman/listinfo/applescri
pt-users>,
<
mailto:email@hidden?subject=unsubscribe>
List-Id: Help and discussions for scripters developing scripts and
solutions in AppleScript. <applescript-users.lists.apple.com>
List-Post: <
mailto:email@hidden>
List-Help: <
mailto:email@hidden?subject=hel
p>
List-Subscribe: <
http://www.lists.apple.com/mailman/listinfo/applescript
-users>,
<
mailto:email@hidden?subject=subscribe>
X-Cam-ScannerInfo:
http://www.cam.ac.uk/cs/email/scanner/
X-Cam-AntiVirus: No virus found
X-Cam-SpamDetails: scanned, SpamAssassin (score=0, FROM_CRSID -0.74,
FROM_ENDS_IN_NUMS 0.74, USER_AGENT_ENTOURAGE 0.00)
Gurus,
Can anyone explain what is going on with this script? Mac OSX Panther and
Acrobat 6 Pro -- if you have Acrobat's JavaScript Debugger window open you
will see the output:
-------------
set f1 to "/"
set f2 to POSIX path of ":" as string
set script1 to "var f = \"" & f1 & "\";console.println(f);"
set script2 to "var f = \"" & f2 & "\";console.println(f);"
tell application "Acrobat 6.0 Professional"
do script script1
do script script2
end tell
-------------
Why does "script1" complete, but "script2" error? This is totally
reproducable OMM -- any file path generated as per line 2 above will error,
the same path typed or pasted in will work.
Failing that, how do you get the front document in Acrobat using JavaScript
rather than AS? This is to do with Ian's XML export problem in his
"Applescripts for Acrobat 6.0" email.
TIA,
Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.