That script works fine for me in Acrobat 7.0 (sorry, don't have version 8 on my home computer right now).
do script "this.getField('AE').value"
Edit: I do have version 8, and your code works fine for me in 8 as well. Are you sure there's a field named 'AE' in the document?
Note: I tried it with Acro Pro 7 but get "undefined" not the value. (osx 10.6.2)
I also tried it in osx 10.4.11 with Acro Pro 7 and it did work.
I really need it to work in osx 10.5 which with Acro Pro 7 gives me the same "undefined", no value, and errors with Acro Pro 8
I don't know how to make sense of this??
I'm running under 10.4 as well at home. I'm not sure why that would be different in 10.5, perhaps there is a bug and applescript is trying to interpret the 'do script' command.
I did notice that when I run the script, I get the same message as you are receiving if there is an error - if there is no document open, or the field being referenced does not exist (or is misspelled). I'll see if I can test it under 10.5 when I get to work tomorrow to see if I get the same results.
Came across this post: http://forums.adobe.com/thread/286675
It seems that 'do script' is broken for Acrobat in Leopard, the workaround is to save the script out to a text file and run it from that file.
Thanks for the reply. That works except I'd like to include a variable determined earlier in the script. The js command isn't the same every time. How do I get around that if its a file?