Bridge - Voluntary Scripting Guidelines

I made a first post on this at ps-scripts:
http://www.ps-scripts.com/bb/viewtopic.php?t=176
It seems to me we would benefit from developing 'good practice' guidelines for Bridge scripting. Here are some intial issues that occur to me:
1. Function namespaces:
Given the use of start-up scripts and the loading of script libraries at start-up it is important we keep function names unique. I am going to use ah_myfunction() for all my own function names. It is also sensible that scripts should use libraries where one already contains a function, rather than duplicating the library function within another script - giving rise to a potential namespace conflict between different versions later.
2. Bridge menus:
Given how central scripting is to Bridge I feel there should be a top-line scripts menu (which I wish could be accessed via an FKey). We could call it 'Scripts' (lol). All non-startup scripts could be listed within that menu - perhaps some guidelines as to order would be useful - maybe alphabetical. It would then be optional to group those further as to application target (in many cases this would be unnecessary). If they are to be grouped by application it may be better to simply organise them with separators rather then put them in further submenus - I resent every extra click I have to make when accessing menus, especially when I am using automation to start with.
To add some background to this point - while the menu customization potential of Bridge is attractive I believe it will mainly be used by scripters rather than by the broader user community. If scripters start creating individual menus as part of scripts they then distribute to a wider audience without consideration of what other scripters are doing things are going to get very messy very quickly. I could start off making an Andrew Hall Scripts menu and why not put next to that a link to my website and maybe to my artsite too etc.etc.
3. Start-up versus one-off scripts.
In many cases it is possible to create a script that does a particular task either as a startup script (the openshut.jsx script is an example of this) or as something that only gets run when required but which is not loaded at startup. I would say that where-ever possible scripts should be created as one-offs (ie not within the startup folder).
4. A Non-Startup Scripts folder and a ScriptData folder
With people writing and releasing non-startup scripts for Bridge, we (and especially the users) would benefit from having them generally put in the same place. My suggestion is to follow the organisation of Photoshop ie Bridge/Presets/Scripts.
Then, some scripts generate data files, access help files, etc, these need to go somewhere. Xbytor and I discussed this a while back in relation to Photoshop and agreed to use subfolders (I use the subfolder AndrewHallScriptData) within a new folder ScriptsData within the Presets folder. I suggest the same would work for Bridge ie Bridge/Presets/ScriptsData/YourFolder/
I am an absolute beginner to Bridge scripting so don't take the above as indicating I think I know better about this stuff than anyone else, I don't. Maybe some of these issues are misguided due to a lack of thorough understanding - if so I am happy to learn more. My issue is that I am about to release some Bridge / Photoshop scripts and I would like to organise them sensibly along the sorts of lines outlined above.
Andrew

I agree that, in the long run, things will get to be a real mess with global variables and function names conflicting right and left and anarchy in the menus if there aren't some guidelines. It probably won't happen soon because there won't be a flood of add-in scripts for awhile, so Adobe probably has some time to figure this out.
Along the lines that Andrew started, here's what I would suggest:
1) To solve the conflicting name problem, use the "#script script_name" directive (or invent a new #namespace directive) to automatically scope all global variables/function names to a single namespace under that directive. Since some functions need to be public, make a new way to declare just those as public. Perhaps use the #export directive to explicitly declare variables/functions that should be visible outside your #script namespace. Allow all script files with the same #script name to automatically be in the same namespace.
This would give you the best of both worlds. You'd have easy sharing between your own scripts by just using the same #script name on all of them, all variables would be private by default and you'd have a simple way to list the few functions/variables that you wanted to be public.
2) Menus. I like the menu flexibility we have now. It needs to be expanded to include other user interface elements like the filter's drop-down menu and other interface elements like toolbars. What I think is missing (or I haven't found) is the ability to have non-startup-loaded scripts that just automatically appear in a generic "scripts" menu. This would be just like actions automatically appear in the actions UI in Photoshop or filters automaticaly appear in the filters menu. Bridge should have a "scripts" menu for scripts that don't need to be loaded at startup and only need to run when invoked. This would also contribute to the namespace collision problem because scripts loaded in this manner would run, do their thing, and then be unloaded and wouldn't have a chance to conflict with other scripts that were run the same way.
--John

Similar Messages

  • CS6 Bridge startup scripts, AGAIN!

    Had the same problem with CS5 and beta CS6, Bridge startup scripts won't load, meaning the outout pane is blank.
    Over the past 2 years, 2 different computers, 3 hd's, clean installs on all and I keep getting the same problem.
    This time, standard install on Lion 10.7.3 mac pro mid 2010 16gb RAM ssd, permissions repaired before/after install, diskwarrior run before install. Works fine on my laptop.
    Getting a bit frustrated with Adobe, same problem hasn't been sorted out in the past 2 years.
    There was a helpful post in the old CS6 forums for a cure, but surely we shouldn't have to do this Adobe, again?

    Might get a better response if you post in Bridge Script Forum  http://forums.adobe.com/community/bridge/bridge_scripting

  • Bridge CS2: Scripting metadata w/o XMPScript?

    Hi,
    I need to get at strcutured data types (bag and alt) and I can't figure out how to do this in CS2, or if it's even possible. I've looked at the sample code in the scripting guide, but it doesn't seem to be of use. Here's what I've tried so far to get the first element in the alt structure xmpRights:UsageTerms field (labeled x-default):
    var tn = new Thumbnail(fileName);
    var md = tn.synchronousMetadata;
    md.namespace = "http://ns.adobe.com/xap/1.0/rights/";
    var rights = md.UsageTerms;
    Window.alert(rights["UsageTerms/xmpRights:x-default"]);
    Any suggestions?

    John,
    I think you are misunderstanding two things about the Bridge Metadata object and XMP.
    First, the Metadata object will return only Strings, not objects that represent nodes in the XMP data model.
    Second, the xpath syntax you are trying to use to access the x-default member of the array is incorrect.
    Try a script like the following:
    #target bridge
    var thumb = app.document.selections[0];
    var md = thumb.synchronousMetadata;
    try {
    md.namespace = "http://ns.adobe.com/xap/1.0/rights/";
    var usageTerms = md["UsageTerms[@xml:lang='x-default']"];
    $.writeln( usageTerms );
    md["UsageTerms[@xml:lang='x-default']"] = "Changed";
    } catch( e ) {
    $.writeln( e );
    This may be a usable workaround for you if you need to deploy scripts that run on CS2 and cannot use XMPScript.
    If you can I recommend using CS3 to develop the scripts for CS2 because it has some tools that may make your job easier. First, you can use utiltiy functions in XMPScript like XMPUtils.composeLanguageSelector() to create well-formed xpaths to use in your CS2 scripts. Second in Bridge CS3 exceptions thrown by the XMP toolkit when the Metadata object tries to get a property (ex: when a script calls var foo = md["bogus/xpath"]) will be reflected as JavaScript exceptions with the error message from the internal C++ exception. If, for example, the property name or namespace URI are bad, it's now much easier for the script writer to determine what is wrong than it was in CS2. This is one of my favorite, unsung new features in CS3.
    -David

  • Changes to using graphic settings in Bridge CS6 scripts

    The "CS6 Tools Guide" document shows no changes in how graphical settings should be used for Foreground Colour, Background Colour, Fonts and Font Size, as well as the use of Images in panels.  All these work as before with scripts used in Photoshop CS6.  But with Bridge CS6 the use of an image will crash Bridge, whereas the settings for Colours and Fonts are just ignored.  Does Bridge CS6 now have customised settings for graphical changes to panels?  Or is this a bug?

    I'd much rather have 32 bits that do what they ought to… sounds like CS6 has 48 that don't…

  • How do you script guidelines onto a document

    I'm new to this, but I've gone through the reference manual and scripting guide and cannot find the method that places guidelines. The description of the guideline properties is there, but I can't find the method.
    Thanks in Advance.

    Here is a function you can use to place guides. It can be used like any function and does not need to be loaded as a action.
    function setGuide(pxOffest, orientation){
    var desc = new ActionDescriptor();
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble( charIDToTypeID( "Pstn" ), charIDToTypeID( "#Pxl" ), pxOffest );
    desc1.putEnumerated( charIDToTypeID( "Ornt" ), charIDToTypeID( "Ornt" ), charIDToTypeID( orientation ) );// "Vrtc" or "Hrzn"
    desc.putObject( charIDToTypeID( "Nw " ), charIDToTypeID( "Gd " ), desc1 );
    executeAction( charIDToTypeID( "Mk " ), desc, DialogModes.NO );
    setGuide(150, "Vrtc");

  • Missing bridge startup scripts

    In bridge CS4 I am trying to use the Output feature to create a PDF contact sheet. However, when I click on that, I get a new workspace but I get no features in the output panel, it's blank. In reading the bridge PDF help manual, it says that one should use the Adobe Output Module script to do this: "If the Output workspace is not listed, select Adobe Output Module in Startup Scripts preferences." However, when I go to Preferences, Startup Scripts, and select "reveal scripts" there are no scripts shown at all.
    Where can I find them? Is this also why when I select the "Tools" menu item, there is no "Photomerge" choice?

    I have gone to Bridge->Preferences->Startup script panel. The Adobe Output Module is not listed. In fact, there is nothing listed in the panel.
    I have installed Photoshop CS4 but the photomerge options do not appear on the Tools->Photoshop menu of Bridge as they did in CS3. The only choices that appear are "Batch rename", 4 Metadata items, and "Cache".

  • Bridge/Photoshop Script Example Please

    Does anyone have an example Bridge script that they can share that
    1. Runs on a selection of images from Bridge.
    2. Calls a simple action in Photoshop (resize and sharpen, for instance) for each image in turn
    3. Saves the images into a new folder or with different filenames.
    The key here is work from the selection in Bridge. Yes, I know I can do that with a Batch, but its important that it be from the script with no batch involved.
    Thank you in advance!!
    Eric

    Hi Eric,
    I remember there was a script called OpenClose_PS.jsx by Bob Stucky on Adobe Exchange. This script does almost all that you want. But the site is temporarily out of service right now, so if you are interested, contact me by e-mail and I'll send you a copy.
    Kasyan

  • Saved File Groups Issue in Bridge Center - script problem?

    Hi all,
    I tried posting this in the Bridge forum with no replies. After browsing through this forum I'm wondering if this is a script problem?
    I have the CS2 premium, and use all packages. The problem I have is saving and retrieving files in the 'Saved File Groups' of Bridge Center. I can save Photoshop files no problem, but the idea is to be able to save other files from open applications in the group and then to recall them later. I can save Illustrator files with others in a group but only Photoshop files open, and it ignores the saved Illustrator files.
    With my InDesign files, it does not even recognise them as files to be saved. I can have a file open, click on "Save open files into a file group" and it will come up with a little box saying there are no open files to save!
    OS - XP sp2. Bridge 1.0.2
    If this can be helped with scripting, please explain clearly, I am a graphic designer and no very little indeed about scripting.
    Your help would be appreciated.
    Thanks,
    Thysje Arthur

    Hi,
    Do you mean that Windows displays “Network Shortcuts” folder when you click “Browse” icon? If so, please check if you configure the default local file location to the “Network Shortcuts” folder. You could refer to the image below to find the option of the default
    local file location.
    Best Regards,
    Mandy 
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Opening Bridge from script

    Hello,
    I want to open a Bridge in specific folder, after finishing script, so a designer could watch through the resulted files, is it possible? If it's a simple answer, pls don't blame me, but I couldn't figure it out...
    Best regards,
    Maciej Siwek

    This example will open the desktop folder in Bridge...
    var bt1 = new BridgeTalk;
    bt1.target = 'bridge';
    bt1.body='app.document.thumbnail = Folder("~/desktop");';
    bt1.send();

  • Bridge CS6 Script to Find Multiple Images in Multiple folders.

    Is it possible to have a script to find multiple images within multiple folders that is on a external hard drive?
    For instances I have a external hard drive assuming it's for a library of pictures.
    Inside this hard drive has folders named as below
    1-1000
    1001-2000
    2001-3000
    3001-4000
    If I had a perfect csv file for example that calls out for specific pictures for example 2, 10,1500 and 2000 (remember think big, it may be a larger list than this it could be hundreds or thousands of pictures); is there a script that would allow me to find these images and save a copy of them on to my desktop so that way I don't have to hunt for them in the old fashion way? I can read scripts but writing them is a different story.

    If you want to go with Batch I would recommend creating an Action of more or less these steps:
    • set the resolution to the same as the background image’s
    • change the image from Background Layer to regular Layer if necessary
    • convert it to a Smart Object
    • add a Drop Shadow Layer Style to the image (do not use Global Angle)
    • place the background image (File > Place …)
    • move it behind the image layer
    • Image > Reveal All
    • make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
    • select and transform the image layer to fit the intended position
    This would naturally work out best if the images had the same size and proportions.
    For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
    Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option.

  • Bridge Scripting Capabilities (CS3 Javascript)

    Hi -- We have many users at our company who need to edit metadata in images (primarily jpegs, but some tifs). These users do not have access to Photoshop but do have access to Bridge.
    I have written a script in Bridge that opens a dialog window for them to edit certain metadata. It is accessed through the tools menu.
    The problem is I need to further automate the process but am unsure what the capabilities of Bridge are.
    What I would like to try to do:
    Currently the user would need to open Bridge, select the item (or drag the item onto the Bridge shorcut) and choose the script from the tools menu. Would there be any way to automate this further, maybe through some sort of folder action, or a trigger when the user drags a file onto the shortcut. Or is there anyway to assign shortcut keys in Bridge to Scripts?
    Also, is there anyway to script Bridge so that the files will be copied (and renamed) to a specific folder (again, without photoshop)?
    Any ideas would be appreciated. I have not used Bridge that much, so if I am going the wrong direction with this, please speak up. If anyone wants to point me in another direction, that would fine.
    thanks

    Hello,
      I'm a Bridge Quality Engineer.
      If you want to write the scripts to auto your cases, please firstly download Bridge SDK and read the DOM API of Bridge. I believe these documents will help you a lot. Please download the SDK from http://www.adobe.com/devnet/bridge/, and read the doc in folder 'docs'. The API provided are described in Bridge CS3 JavaScript Reference.pdf.
      After read it, you will find you can call the API to auto the process instead of 'through some sort of folder action, or a trigger when the user drags a file onto the shortcut'.
      And you can also get help by launching Adobe ExtendScript Tooolkit, which is installed automatically when Bridge is installed. By select menu Help-> Object Model Viewer, you can get info of Bridge DOM API, and also Core JavaScript Classes and Script UI Classes.
      Please check the API of File and Folder(in Core JavaScript Classes), and you can find File has copy() API, by using which you can copy files to a specific folder.
      If you have further question, please send it out.
      Thanks for support!
    BR,
    Chun Xia

  • Bridge CS4 not using newly installed Enhanced Image Processing Photoshop script

    Hi all,
    Hope someone can help here.  We just added this Photoshop extention:  Enhanced Image Processor by Manovi to our Photoshop CS4's Presets/Scripts folder.  Here's my problem.  The new image processor opens and runs great - in Photoshop.  But when I'm in Bridge CS4 and choose Tools>Photoshop>Image Processor it opens/uses the old script.  Does Bridge cache this kind of thing or what's going on.
    How can I get Bridge to use the new image processor?  (note:  Old script was replaced by new one in Photoshop's preset/scripts folder - the old one is no longer there - although we did save a copy of it elsewhere)
    Thanks

    I don't have CS4… but in CS5 the paths to the files in Photoshop's scripts folder are coded into the functions that call them… Bridge reads these files on request evaluates them then runs… I would suspect the file name may differ from what it's looking for… Have you tried calling it the same and placing it in the same location? If this fails you may need someone to edit the Bridge startup script (not a job for the faint hearted)… Sorry but that ain't going to be me it uses localized strings don't understand them yet… Paul R may well say he can do it I don't know… So NOT cached… but possibly NOT read either in you case…

  • Image Processor Tab Missing in New Adobe Bridge CC 2014

    In the new Bridge CC you used to have a TAB under tools called Photoshop which you could run the script Image Processor for easily processing jpegs. What has happened to this and is their maybe a new way of processing jpegs to lo-res that I dont know about from tiff or jpeg or does my bridge have a problem?
    I have attached a image grab from my bridge that shows that the tab is not there. I know that you can access image processor directly from Photoshop, but they used to always be linked.

    No, it is still in Bridge CC.
    Did you uninstall Photoshop CC after installing Photoshop CC 2014? If so, that may have removed some of the Bridge integration scripts by mistake. Re-installing Photoshop CC 2014 should replace the scripts.
    and it should give the image processor tab back

  • Filename to IPTC Title, but without extension. (Currently using DAM script)

    Hello,
    Apologies if this isn't the correct forum to ask this question:
    I am currently using the DAM Filename to Title script with Bridge CS4 - http://www.damuseful.com/pages/PimpMyBridge.html - to get the filename into the IPTC title script. This however puts in the extension into the title field also. So a JPG file named 2000 ends up with 2000.JPG in its Title field. I wish to not have the extension appear in the Title field.
    Is this possible by modifying the DAM script / using any other freely available script.
    In case it helps, this is what the DAM script currently looks like:
    #target bridge
    if ( BridgeTalk.appName = "bridge" )
    //This script copies selected thumbnails' filenames to the title field
    //Also shows how to add menu items
    //The AdobeLibrary scripts must be loaded
    //This script was created by John Beardsworth www.beardsworth.co.uk/ and modified by Peter Krogh www.DAMuseful.com
    //This script may be freely distributed and modified
    // Let's create our menu
        var menu = MenuElement.create( "command", "Write Filename to IPTC Title Field", "at the end of Tools");
        menu.onSelect = function(m)
    var getFolderChildren = true ;
    var filesOnly = true ;
    var thumbs = getBridgeThumbnails ( TYPES.PHOTOSHOP_OPENABLE, getFolderChildren, filesOnly) ;
    for ( var i = 0; i < thumbs.length; i++ )
    { thumb = thumbs[i];
       md = thumb.synchronousMetadata;
       md.namespace ="http://ns.adobe.com/photoshop/1.0/";
       md.Title = thumb.name;
       Window.alert ("Done " + i + " records");
    There are also 3 other Adobe Library scripts that come with the download.
    I know absolutely nothing about scripting, so baby-steps would be appreciated.
    Many thanks.

    Change:
    md.Title = thumb.name;
    To:
    md.Title = decodeURI(thumb.name).replace(/\.[^\.]+$/, '');

  • Cdr file preview in Bridge CS6

    Anyone knows why Bridge CS6 wont display larger previews of cdr files?
    The previous version I had (CS4) handled cdr files without  any problem.
    Thanks

    Sorry I don't have an answer either, szf611.  In fact, I came here looking for an answer to this myself.
    I had a vague memory that the ability to view CDRs might have come from a Bridge extension, rather than being a native capability, but I could be wrong about that.  (Maybe I'm thinking of the "Bridge Here" script?)  I don't know if it would have come from Adobe or Corel.
    If I find any solution, obviously I'll post back.  You haven't found any more info since opening the thread, have you?

Maybe you are looking for

  • Default Values for Select-options In Webdynpro-ABAP

    Hi Freinds, Kindly,Help me in setting the Default values for the Select-options in Webdynpro ABAP. Here the Node and the Attributes are Created Dynamically, and then Displayed Select-options Component View. Regards, Xavier.P

  • How do I control DC output using a counter

    I need to step up DC output (ch. 2) at the same frequency of a triangle wave output (ch1). Can this be done and how? SL

  • Automatic delivery block to be reduced - Credit management?

    Hi All, I was asked by a user to change automatic delivery block from 60 days to 30 days for a given credit control area. On further talks with the user, she gave an example where a customer had overdues for more than 60 days and hence went on a bloc

  • JDeveloper and Eclipse interfacing through Subversion

    WE have a project on Eclipse. We are using Subversion for source version control. Now I've downloaded JDeveloper 11g and would like to bring the project in it. It means some will use Eclipse whereas I want to use JDeveloper and the central repository

  • Export PP project - Build DVD in Encore

    I have a quick and hopefully easy question. I imported my footage into PP as HDV 1080i 29.97 and have completed the editing I wanted to do. I'll be making a few hundred DVD copies of this and am stuck on the best settings next. Obviously I want this