Bridge: Restore Export Panel In Bridge

  • 63
  • Idea
  • Updated 4 months ago
  • (Edited)
Why was the Export Panel dropped from Bridge CC? The Export to Disk is an incredible time saving routine, especially for those of us who find the Light Room catalog structure underwhelming, and instead use Photoshop and Bridge.

The Bridge CC Tools > Photoshop > Image Processor is a work around, but is now where near as clean, flexible, and fast.

Why was it dropped from Bridge CC?

Here is a screen shot from Bridge CS6:
Photo of Dan Clements

Dan Clements

  • 7 Posts
  • 5 Reply Likes

Posted 6 years ago

  • 63
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
For those of you wanting JPEG export from Bridge... I'm working on a ScriptUI/Extendscript palette that restores JPEG export to the hard drive. Its about 80% implemented right now. I may charge for it, not sure yet. First I need to finish it.
There are a LOT of bugs and poorly documented features in ScriptUI, and layout differs from the Mac to the PC. Adobe doesn't make it easy to develop on this platform! I'm a Mac user personally but I've done much of the development on Windows thus far, and my goal is for it to work seamlessly across platform.
Anyway, I anticipate having it ready to test this spring. A sneak peak of where I'm at so far:
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
That screenshot was taken on Bridge CC 2018, High Sierra. SO far the layout is ok on High Sierra, Windows 7, and Windows 10. I have to do a lot of testing of course but so far, so good.
Photo of Cory Barlow

Cory Barlow

  • 13 Posts
  • 11 Reply Likes
DNG to be supported?
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Yes actually, hadn't thought of that but DNG would work fine. Pretty much any format that Bridge can render will export.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I added a summary panel which can be hidden, a preference for overwriting existing files, and DNG support. Everything shown is now implemented, I'll be testing functionality and then release a beta for testing.

This has gotten WAY more complex than I anticipated in the beginning. Screenshots from Windows 7, Bridge CC 2018.



Photo of Cory Barlow

Cory Barlow

  • 13 Posts
  • 11 Reply Likes
I happily volunteer for beta testing...
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Good news! My project is ready for code review and testing!

I decided to release this under the Apache 2.0 license as open source freeware, so others can tinker with and improve it when they find bugs or have feature suggestions.

THERE ARE PROBABLY BUGS. Please be aware that I have done limited testing, although development was split between Mac and Windows platforms so it should work fine on both.



Use is pretty simple. Select a folder or Collection, choose image files, and click the Export button.
If you want to apply options, there are plenty to choose from.

The project is available as a .zip file containing JPEGexport.jsx. Copy this file into your Bridge Scripts folder and relaunch Bridge. You'll see a new menu item under Tools.

Temporary download link (14Kb):

http://lumigraphics.zenfolio.com/img/g153581469-o367026446.dat?dl=2&tk=Ziz7_TuiTXO7zofwYhILPsmjc...=

If you find bugs, please let me know here or via email. Feel free to send any coding suggestions or bug fixes as well.
dev@lumigraphics.com
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
http://lumigraphics.zenfolio.com/img/g153581469-o367026446.dat?dl=2&tk=Ziz7_TuiTXO7zofwYhILPsmjcwWM03SarOramLoYAtk=
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Very good David, one thing that could do with amending is your date formatting.
Days or Months should have a leading 0 if less than 10.
A button to close the palette would be nice along with an alert when the batch has completed.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I originally added a leading zero for the dates and decided to take it out. I have that in the log file date stamp though.

Hadn't thought of an alert on completion. I can add that easily. The system close widget works on both platforms, I'd have to find room to add another button to the clutter ;)
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
There is one potential error using app.document.getSelection(). If no documents are selected ALL files of type are selected.
Might be best to test first...
if(app.document.selections.length > 0) {
    thumbs = app.document.getSelection('psd, jpg, jpeg, png, tif, gif, bmp, pdf, ai, dng, crw,cr2,nef, arw');
    }
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I already found a missing semicolon too. I thought I got them all. I also have to fix the logfile date stamp.

And yeah I see, if no thumbnails are selected, it gets all visible thumbs. How nice.
Photo of Cory Barlow

Cory Barlow

  • 13 Posts
  • 11 Reply Likes
On first test, this seems to work great! (I to would like an indication of when it is finished running, or just have the window auto-close.) Good work!
Photo of David Converse

David Converse

  • 587 Posts
  • 175 Reply Likes
Ok, I think the finished notification is a good idea. I've fixed a couple of things and have a few more to do tonight. Will have a new build tomorrow possibly.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Ok, new build. Fixed the problem with no files selected, fixed a couple of typos, padded dates with a leading zero as needed, fixed the log file date stamp, added a notification dialog when finished that allows closing the window.
I banged my head against the wall trying to get a progress indicator and apparently window.update() (JavaScript Tools Guide CC, page 121) doesn't work in Bridge. Once the thumbnail export loop starts I can't break out of it except with an alert dialog :sigh: So it looks like a progress indicator might not happen.

Anyway, new link (old link is kaput):

http://lumigraphics.zenfolio.com/img/g474964006-o367026446.dat?dl=2&tk=NQD9Y5kDUD0a4o1fmyOyGIsmMy8rdrcH32kav5Gcq50=
Photo of John Weber

John Weber

  • 57 Posts
  • 6 Reply Likes
For some reason I'm not getting the notification dialog. Otherwise looking good.
I do kind of wish it would remember settings, but that's not a big deal.
(Edited)
Photo of Cory Barlow

Cory Barlow

  • 13 Posts
  • 11 Reply Likes
Same over here. No notification for me, everything else looks great, and yeah defaulting to the last settings I used would be convenient.
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
David, I was thinking that you might be able to speed the script up by a vast amount when the user is doing a resize 1024 or less by using bm = Thumb.core.preview.preview; rather than using spec.

#target bridge
var Thumb = app.document.selections[0];
if(app.document.selectionsLength >0){
app.synchronousMode = true;
bm = Thumb.core.preview.preview;
app.synchronousMode = false;
$.writeln("Preview - Width = " + bm.width +" Height = " + bm.height);
}
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I'll try that! I have a new build ready to upload, fixed the notification not showing, added an auto-close option, did a couple of other minor changes. Will be posted tonight.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Latest build:
http://lumigraphics.zenfolio.com/img/g282586038-o367026446.dat?dl=2&tk=4fOIQNDz4TmO_vpGiEPhFHxR3AE3g28rzAT2544fErs=
I haven't added Paul's code yet, I'll have to test that in a snippet to see how it works.

Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I'm still considering how to preserve settings, as well. Probably just save a settings text file.
Photo of felubra

felubra

  • 9 Posts
  • 8 Reply Likes
You could use a SQLite database.
Photo of JoeS

JoeS

  • 89 Posts
  • 19 Reply Likes
Thank you so much David for your great work.
If you like to have it translated to German let me know.
Photo of Cory Barlow

Cory Barlow

  • 13 Posts
  • 11 Reply Likes
Indeed, many thanks David, this is turning into great little tool. Everything works for me now. Hope that *preserve settings* happens, but it is quite useful in its current state. Cheers!
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Way too much work to write to a db. I'm gonna see how work it would be to write an XML file (plist.) That would enable presets if its not much work.

And thank you for the localization offer! Once this is done that would be great.
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Hi David here is a suggested modification to your code. It can speed up the extraction if a resize is less than 1025, also auto rotate if no metadata or IPTC only is selected.

                        bm = [null, null, null, null]; //array of bitmaps for rotations
                        if(sizepnl.cb1.value && Number(sizepnl.etxt1.text) < 1025){ //Extract Cached Preview
                            app.synchronousMode = true;
                            bm[0] = thumb.core.preview.preview; //cached bitmap
                            app.synchronousMode = false;
                            }else{
                        bm[0] = new BitmapData(thumbs[i].spec, colorspace); //new bitmap object
                        }
                    if(metapnl.ddl1.selection != 0) bm[0] = bm[0].rotate(thumb.rotation); //Auto rotate if No Metatdata or IPTC only
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Sorry for the lack of updates. I've been out of commission with the flu since last week.
I've been testing an xml preferences file and have the logic working. That will save and restore the last used settings and allow saving of presets. I should have that implemented in a few days and then I'll add in the cached preview code.
Will update when I get a new build loaded. Thank you for the support and suggestions.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Ok, new update: This zip file includes the script, a Read Me file, and a sample .xml settings file.
I have implemented saving and loading of preferences. This is not yet properly tested on Windows but should work; it works on the Mac platform correctly.

Loading and saving of presets (.xml format) is implemented but the buttons disabled. See the Read Me file for more info.

This is a testing release, there may be bugs related to loading and saving settings.

I haven't gotten to the resizing optimization yet; that will be the last feature added before final testing and release.

http://lumigraphics.zenfolio.com/img/g252817971-o367026446.dat?dl=2&tk=9HqOKSal3VdMRJfEG81Q4FUMtt80_F9x3ChcPB9YOrw=
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Just found a typo, the code should be:-

        if(prefsXML.filename.current.toString() == 'Current'){
           namepnl.rbtn1.value = false;
            namepnl.rbtn2.value = true;
            }
        else{
            namepnl.rbtn1.value = true;
           namepnl.rbtn2.value = false;
            }

you had == also you had them both the same.

So far so good David.
Photo of Michael Eicher

Michael Eicher

  • 16 Posts
  • 12 Reply Likes
how paltry is it, that users have to write their own Code, instead that Adobe brings back a most wanted Feature?!
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I'll be posting a new build tonight, this is feature complete with Paul's suggestion for speeding up exports, load and save presets is finished, a few typos are fixed, panels are sized correctly.

This will be the final feature addition because this script is now feature-complete and only needs testing (subject, of course, to any killer ideas that someone may have...)

Adobe is launching a new Adobe Exchange site to replace the old Add-Ins site, once that is up and running I will be placing it on Adobe Exchange.
Photo of Michael Eicher

Michael Eicher

  • 16 Posts
  • 12 Reply Likes

Hi,

your last build works fine, and I am able to store settings wherever I want to.

I do not understand 1 Thing: when trying to export into dimensions greater 1000px on the long side, the exporter crashes, and does not export anything. Also it is not asking to close the exporter Window. I think, that is not the right behavior.

This Test was with the 32 Bit Version of the bridge. i will try  the same at home, where I have a win10 /64 System installed.

Thanks for the god Work!


Regards

Mikel




Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Michael I wonder if this script works in the German OS ?
http://www.ps-bridge-scripts.talktalk.net/BridgeProcessor.htm
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
A crash is definitely not good. I don't use 1000px anywhere so that shouldn't make a difference. I did add Paul's code to use previews under 1025px (if High Quality Preview exists) which is a huge speed boost.
Photo of Michael Eicher

Michael Eicher

  • 16 Posts
  • 12 Reply Likes

Hi,


... good News! Trying it in my Win10 /64 Environment, everything looks OK for the Moment. Because the work system is much slower, it may be that it takes more time than expected to export.

A progress bar, or anything that shows, that export is in Progress would help.


Thanks again for your work!


Regards

Mikel


Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I tried to add a progress indicator but once then export starts, I can’t get updates to work. There is a window update method but apparently it’s a new bug that it’s broken. I tried both the existing window and a new window with no luck.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
And final feature-added build, please see the read-me file and release notes in the script.
http://lumigraphics.zenfolio.com/img/g821613041-o367026446.dat?dl=2&tk=8Y5hJJ7RGv2t2-Fn3Kf7IeVQBaL_CpovC6xmLqD7adw=
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Just a couple of things David,
Could you get rid of the alert if the prefences file does not exist, it is not required.
The save and load settings buttons, could you get them to default/open the folder where you save the preferences xml, this would allow the user easy access to where they are to be found.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Yeah the alert can go. I'm not sure if anyone wants to save settings files into the same folder, on the Mac its the user Preferences folder and on Windows its the Startup Scripts folder.  I didn't know where to put the default pref on Windows, there isn't a Mac-style Preferences folder.
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
I like to use Folder.userData then the preferences are available to different Bridge versions.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Yeah its not hard coded to a specific folder, it will save to whatever folder the script is in. I'm not really a Windows user. Stuck with it at my day job.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Still working on getting the leading zeros working. I’ll probably have a new build up early next week.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Ok folks, one more build. Sequence leading zeros work, loading prefs works, Save/Load go to the same folder as the prefs XML file, and a few small bugs squashed. Please see the read-me file.

This should be the last feature update/change version. From here on out its bugfixes if there are any left.
http://lumigraphics.zenfolio.com/img/g249095464-o367026446.dat?dl=2&tk=tdLUo-MJQEDrroJtnHDQXgPrBn11iRRhLps30CTXEEY=
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Have you packaged the correct version David as two bugs still exists?

bm[j] = bm[j].resize(size, sizepnl.ddl1.selection.text); //resize bitmap
size is Zero so script does not work until Bridge is re-started

Auto close checkbox is not being updated
Photo of David Converse

David Converse

  • 503 Posts
  • 153 Reply Likes
Sure enough, doing development in two different places and not synching changes. Both fixed, will update tonight.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Ok hopefully this is the one! I did a bunch of exports and it seems to be fixed all around.
http://lumigraphics.zenfolio.com/img/g418426856-o367026446.dat?dl=2&tk=PwHJbhRQ6EqezvoqZpl7UUcxp7gZDZEmEFlUBtz1FHY=
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
This line has still got a fault:-
bm[j] = bm[j].resize(size, sizepnl.ddl1.selection.text); //resize bitmap
The variable size = 0 and has not got the correct size from the edit field.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
You can't get to that with a blank or zero size field. If the resize field is blank, the option is deselected and it won't resize.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I can't reproduce this but I added code to explicitly set size. It works for me-

with a saved size field
with a blank size field
with a changed size field
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
The trouble is that the size variable in not getting defined before that line hence the value is zero, it is not getting the value from the edit field.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Ok I'll go through the code again to make sure its defined. I'm still trying to figure out the debugger so I can see variables during runtime.
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Okay I have found another bug in the same section with this one, the fixed code should be:
if(overwrite == true){ //only export if true
if(sizepnl.cb1.value == true){ //resize enabled
if(Number(sizepnl.etxt1.text) < 1024) //only resize if less than 1024
bm[j] = bm[j].resize(Number(sizepnl.etxt1.text), eval("BitmapData."+sizepnl.ddl1.selection.text)); //resize bitmap
bm[j].exportTo(exFile, Math.round(setpnl.slider1.value)); //export bitmap to file
bm[j].dispose(); //free memory
}

The size variable was set to zero at the begining of the script so when it got to the resize it was still zero.
Also the resampling method was missing BitmapData. so I've added the eval.
One thing I found was if you try to resize to the same size of the bitmap it will fail so added a test.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
I wonder why it worked for me? I added explicit setting of the size variable so it shouldn't ever be zero. I can't figure out how to use the debugger with this script though. Whether I run it from Bridge or from the ESTK, breakpoints don't work and I don't see any variable values.
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
I don't know why or how it worked for you. I added $.writeln(e + "\n" + e.line); in the catch so it showed where it was falling over. Also added an alert or two to see some of the values.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Yeah that’s what I’ve been doing. Adding the saved preferences has caused a bunch of grief! Lol go figure. But I think it’s close to being done.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Ok I've done this a bit different way but I think I caught everything.

Resize must be smaller than current which I didn't catch before now. I'm testing for size < bitmap dimensions.

Syntax is correct, bitmapData.resize(number, string) where number is size and string is quality. (Object Model Viewer has the syntax.)

I'm now explicitly setting size so it will always have a non-zero value. If left blank, onChange sets the checkbox to false so resize is disabled.
Photo of David Converse

David Converse

  • 590 Posts
  • 175 Reply Likes
Once everything is working, I'm going to release a cutdown version that has the same features as Image Processor.