Copy link to clipboard
Copied
Ok,
I admit that I am a novice with JavaScript, although I have experience developing using Xcode with ObjC and lots of interapplication scripting with AppleScript.
However, I am clearly missing some very basic concepts trying to do some very simple things to script Adobe Bridge.
For instance, I have followed the tutorials and have had no problem running and customizing versions of SnpAddMenuItem.jsx and SnpCreateThumbnailInspector.jsx.
Now, let's say I put the SnpAddMenuItem.jsx in the Startup Scripts folder for Bridge CS6. (works fine and creates menu on launch.)
However, instead of displaying an alert, as in the demo:
alertCommand.onSelect = function (m)
{
var txt = m.text;
// Display result as UI, as this is UI sample
alert("'" + txt + "' was chosen menu item");
// run javascript
//SnpCreateThumbInspectorPanel.Main();
}
I want to run SnpCreateThumbnailInspector.jsx.
Do I:
I have scoured the documentation and much of the sample scripts and can't seem to figure out this seemingly simple concept.
- James
Copy link to clipboard
Copied
Most of the examples are written to be executed from within ExtendScript Toolkit, the supplied IDE.
Just open the script in ExtendScript Toolkit and run it with Bridge as the target.
Copy link to clipboard
Copied
Well...
I'm trying to build a utility that will be used by multiple users, not a one-off script.
Copy link to clipboard
Copied
There should be many examples here on the forum, here is one that you can play with...
#target bridge
if( BridgeTalk.appName == "bridge" ) {
var menu = MenuElement.find ("myNewBridgeMenu");
if (menu == null){
var newMenu = MenuElement.create( "menu", "My Bridge Scripts", "before tools/ps", "myNewBridgeMenu" );
WhatEverYouWant = MenuElement.create( "command", "Test Script", "at the end of myNewBridgeMenu", "BridgetestScript" );
}
}
WhatEverYouWant.onSelect = function () {
alert("This is my new script");
}
Copy link to clipboard
Copied
If I understand you correctly it's 2.
Stick you function in the onSelect event of the item.