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?
#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
...Copy link to clipboard
Copied
Are you wanting to remove just the collections or all the associated files too…?
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.
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…?
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?
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…
Copy link to clipboard
Copied
got it! thanks again!