Re: Acrobat & JavaScript
Re: Acrobat & JavaScript
- Subject: Re: Acrobat & JavaScript
- From: Richard 23 <email@hidden>
- Date: Fri, 5 Jan 2001 16:06:13 -0800
>
Message: 12
>
Date: Fri, 5 Jan 2001 09:27:49 -0500
>
To: applescript users digest <email@hidden>
>
From: George Mack <email@hidden>
>
Subject: Acrobat & JavaScript
>
>
I have a lot of PDF files that need to be edited in various ways
>
(add buttons, etc.).
>
>
Does anyone know if it is possible to add page actions (in
>
JavaScript), buttons, etc. through AppleScript? That would give a
>
great deal of automation support.
>
>
Is there any other way to use Javascript with AppleScript? Since
>
both are Object Oriented, I would think there could be useful
>
"synergy".
>
>
Thanks for any insight. (I feel comfortable with AppleScript, but I'm
>
just getting my feet wet with JavaScript.)
>
>
George
>
--
>
GEORGE MACK DESIGN Scituate, MA 02066 (781) 544-3880
>
Design-Illustration-Desktop Publishing-Miscellaneous Magic
George,
I'm pretty comfortable with AppleScript, JavaScript and Perl and
have used various combinations of those depending on what I wanted
to do, but know nothing about acrobat. If your target is web I
may be able to give you some tips.
But I don't have enough specificity to know what to suggest
I am perfectly capable of going on and on about it anyway. 8)
When it comes to web based stuff, generating html pages and even
javascript code on the fly is always a possibility. The reason
for both is that Perl only runs on the server so once the page
has been written the perl script has already quit, so to continue
to work with the user the JavaScript code is there in the page.
You can load up a page with lots of info (stored in JavaScript
variables) allowing the user to continue using using the page
without needing more info from the server.
If your target is an offline mac you can certainly use AppleScript
to generate dynamic content or JavaScript (but due to security
hobbles you can't directly access files with JavaScript).
But there is also an excellent beta of JavaScript for OSA by
Mark Alldritt <
http://www.latenitesw.com/> which you can use
directly in Script Editor and it functions exactly like JavaScript
in a browser except that its not running in the browser window
paradigm, and you do have access to the Mac OS (therefore the
file system unlike client-side JS). JS OSA is very useful for
developing and testing objects and functions without the additional
drag factor that exists when developing the same thing in the browser.
For one thing you have direct access to the code, you don't need
to switch to a text editor, modify, save, switch to a browser,
reload, find an error, etc, etc.
And although JS OSA doesn't come with a DOM built in (it doesn't
need one...besides which DOM would it be IE or NS ?) it's simple
enough to build your own pseudo objects to simulate the browser
environment. I've found it to be a big help to me in the last
few weeks. I still have no idea what you're asking so I'll
shut up now. Hope this has given you some general ... something
or other ...
R23