• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Delete all image collections

Participant ,
Jul 09, 2014 Jul 09, 2014

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

485

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Jul 10, 2014 Jul 10, 2014

#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 t

...

Votes

Translate

Translate
Guru ,
Jul 10, 2014 Jul 10, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 10, 2014 Jul 10, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 10, 2014 Jul 10, 2014

Copy link to clipboard

Copied

#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…?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 10, 2014 Jul 10, 2014

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 10, 2014 Jul 10, 2014

Copy link to clipboard

Copied

#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…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 10, 2014 Jul 10, 2014

Copy link to clipboard

Copied

LATEST

got it! thanks again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines