Skip to main content
Inspiring
July 10, 2014
Answered

Delete all image collections

  • July 10, 2014
  • 1 reply
  • 750 views

I am looking for a way to delete all image collections from the Collections tab. Is this possible with a custom javascript for Br?

This topic has been closed for replies.
Correct answer Muppet Mark

Thank you!

I know how put the script in the BR startup folder. However, I am not sure how to call this Br script once the application is open?


#target bridge

#engine main

app.bringToFront();

if ( BridgeTalk.appName == 'bridge' ) {

  var toolMenu = MenuElement.find( 'Tools' ),

  ojo = new MenuElement( 'command', 'Remove All Collections', '-at the end of toolMenu', 'ojodegato001');

};

ojo.onSelect = function () { removeAllCollections(); }

function removeAllCollections() {

  var collects = app.getCollections();

  for ( var i = collects.length-1; i >= 0; i-- ) {

  app.deleteCollection( collects );

  };

};

OK if you add this one to you user scripts folder… It should give you a NEW custom option at the end of the tools menu… Click n run there…

1 reply

Inspiring
July 10, 2014

Are you wanting to remove just the collections or all the associated files too…?

ojodegatoAuthor
Inspiring
July 10, 2014

I need to keep the original files. I just need to delete the Br image collections associated with the original files.

Inspiring
July 10, 2014

#target bridge

app.bringToFront();

removeAllCollections();

function removeAllCollections() {

  var collects = app.getCollections();

  for ( var i = collects.length-1; i >= 0; i-- ) {

  app.deleteCollection( collects );

  };

};

This should remove all the Non Smart collections… You will need a way to run this. You can do so from the ESTK else you need to add something to Bridge.

A menu and item or a contextual menu option…?