Need an Applescript Expert

Ralph DiMola rdimola at evergreeninfo.net
Mon Oct 23 19:20:59 EDT 2017


Shake some dust off from my Acrobat JavaScript days...
I think you will have to open the document. You are in a new instance of
Acrobat without an currently open document.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net


-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of Bob Sneidar via use-livecode
Sent: Monday, October 23, 2017 6:57 PM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Need an Applescript Expert

Hi all. 

When populating forms on a Macintosh, I figured out a nice little hack which
allows me to populate a fillable form with values using AppleScript. The
trick is to tell Applescript to tell Acrobat to run a Javascript! Seems a
little convoluted but it works great. 

So I discovered recently that Applescript can run Javascript natively!
Great. I figured I would bypass applescript and pass javascript directly!
But I've run ingo a snag. Here is a quick sample of what works:

tell application "/Applications/Adobe Acrobat DC/Adobe Acrobat.app"
set theScript to "this.getField(\"technotes\").value = \"This is only a
test. \";"
do script theScript
end tell

Don't let the backslash quotes trip you up I am just escapting quote
characters. Now the Javascript version *should* look like this but it does
NOT work!

Acrobat = Application('Adobe Acrobat');
Acrobat.activate();
delay(1);

this.getField("technotes").value = "This is only a test.";

I get an error that this.getField is undefined! Whaaaaa??? Why does it work
as an applescript command then??

Bob S



_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list