0
JavaScript using ExtendScript Toolkit
New Here
,
/t5/bridge-discussions/javascript-using-extendscript-toolkit/td-p/1155736
Oct 18, 2005
Oct 18, 2005
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Beginner
,
/t5/bridge-discussions/javascript-using-extendscript-toolkit/m-p/1155737#M24134
Oct 18, 2005
Oct 18, 2005
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_Joji_Varghese_
AUTHOR
New Here
,
LATEST
/t5/bridge-discussions/javascript-using-extendscript-toolkit/m-p/1155738#M24135
Oct 18, 2005
Oct 18, 2005
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

