Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

JavaScript using ExtendScript Toolkit

New Here ,
Oct 18, 2005 Oct 18, 2005
Hi,

I am new to Bridge and i am using JavaScript.
I am not able to include any java libraries like java.util.StringTokenizer or java.sql etc.
I do not know if i can do this here.
Also does someone know how to execute an AppleScript file from my
current javascript code, and, can i execute some executable or access a shared library from javascript using extendscript toolkit?

Thanks in advance.

Regards
Joji Varghese
TOPICS
Scripting
558
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 18, 2005 Oct 18, 2005
Joji

Sorry, including Java Libraries is not possible.

Bridge does not support AppleScript.

But... Anything that can be executed from the command line can be executed from JavaScript via app.system() - note that this function always returns undefined and does not return control to JavaScript until the command terminates.

I am wondering what you are meaning by shared library. External??? If so, no. Bridge scripts all execute in the same global namespace, so any library script you load will be available to all scripts in Bridge.

This is why "namespacing" is so important. Every script you write should have a namespace object:

ANameUniqueToMeAndMyScript = {};

Then all of your functions and whatnot are defined off of that namespace object

ANameUniqueToMeAndMyScript.myFunction = function() {
}
ANameUniqueToMeAndMyScript.amount = 12;

This way your functions and global values will not step on anyone else's.

Also there are 3 Adobe provided libraries. You can get them from Adobe Exchange by downloading the Import from Camera script.

AdobeLibrary1.jsx - handy objects and functions
AdobeLibrary2.jsx - xml based persistent storage
AdobeLibrary3.jsx - patches to 1 and 2, and a couple of new functions

Bob
Adobe WAS Scripting
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2005 Oct 18, 2005
LATEST
Hi Bob,

Thank you, for such quick reply.
I think i will have go with the last option i.e. using app.system
to execute the executable.

Thanks again.

Regards
Joji Varghese.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines