I don’t have Acrobat 8 anymore, but in 9 the scripting dictionary says:
do script‚v : Perform a JavaScript.
do script [text] : The actual text of the JavaScript to perform.
[file alias] : The file containing the JavaScript to perform.
I don’t see a command for do javascript
I don’t know why it wouldn’t work in Leopard. Any differences on your Leopard machine? Did you run it on the same document so you know it’s not the document that caused the error?
I have done several tests, using Acrobat 7 through 9 on Tiger, Leopard and Snow Leopard. Found Tiger works fine but not Leopard and Snow Leopard, regardless of which version of Acrobat used.
The result returned is:
Any advice on how to overcome this OS dependent issue?
You will find numerous posts here about using javascript being broken in Acrobat on the Leopard OS. Many suspect Applescript’s change to Unicode text. It would look like from Shane’s comments with X that this has been addressed. I don’t have 9 or X so I can’t really comment further.
Yes, it also works here with v9. I see a comment in a script here that uses js to to add annotations: “not working with Acrobat 8 under OS 10.5, but works with Acrobat 9 in OS 10.5 and 10.6”
In your application preferences you will have a tab on ‘JavaScript’ in that you can enable JavaScript and a few other related options. Make sure you have this set to on.