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

New folder from selected items - in Adobe Bridge

Community Beginner ,
Sep 03, 2018 Sep 03, 2018

Copy link to clipboard

Copied

Hi

Is there a way to create 'New folder from selected items' in Adobe Bridge (Similar to the Finder functionality on a Mac) ?

Thanks

Nige

TOPICS
Scripting

Views

3.0K

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
Community Expert ,
Sep 03, 2018 Sep 03, 2018

Copy link to clipboard

Copied

The JS scripting reference shows NewFolder and MoveTo commands, so I am guessing that this would be a “simple” enough task for those that posses this arcane knowledge to create a one click script.

Otherwise it would be a manual 2 step process using built in methods:

step1.png

step2.png

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
Community Beginner ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

Thanks Stephen , I haven't done any scripting with Bridge yet, but i'll investigate, I know Javascript. Thanks

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
Community Expert ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

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
LEGEND ,
Sep 10, 2018 Sep 10, 2018

Copy link to clipboard

Copied

This would be fairly easy to do with a script. Four steps:

Get new folder location and create folder

Get list of files

Move files to new folder

Resolve naming conflicts

I don't have time to write a sample but you can look at the sample scripts from the SDK as a start.

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
Guide ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

To use, select your documents then right mouse click "New folder from selected items"

Enter the name for the new folder.

#target bridge;

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

selItems = MenuElement.create("command", "New folder from selected items", "at the end of Thumbnail");

}

selItems.onSelect = function () {

var thumbs = app.document.selections;

if(thumbs.length <1) return;

var win = new Window("palette","New Folder");

win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});

win.p1.alignChildren="fill";

win.g10 = win.p1.add('group');

win.g10.orientation = "row";

var txt = "New folder from selected items (" + thumbs.length + " items)";

win.g10.et1 = win.g10.add("edittext",undefined,txt);

win.g10.et1.preferredSize=[300,20];

win.g20 = win.p1.add('group');

win.g20.orientation = "row";

win.g20.alignChildren=["fill","fill"];

win.g20.bu1 = win.g20.add("button",undefined,"Create Folder");

win.g20.bu2 = win.g20.add("button",undefined,"Cancel");

win.g10.et1.active=true;

win.g20.bu1.onClick=function(){

var newFolder = Folder(app.document.presentationPath + "/" + win.g10.et1.text);

if(!newFolder.exists) newFolder.create();

win.close(0);

for(var a in thumbs){ thumbs.moveTo(newFolder);}

}

win.g20.bu2.onClick=function(){win.close(2);}

win.show();

};

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
LEGEND ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

If you run this script from a search (and probably from a collection), it will NOT work right.

There are some bugs with presentationPath and it doesn't work with duplicate filenames. I'm afraid it needs some error checking and a way to resolve duplicates, and also a way to check for valid presentationPath.

I ran into a bunch of this with my JPEG multiexport script and had to manually account for edge cases and duplicates

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
LEGEND ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

To elaborate, a collection's presentationPath is the collection file on disk. For special folders (on Windows at least) like Computer or the Libraries, its either a file or a temp folder. For searches and View->Show Items in Subfolders, there is no presentationPath returned.

Even having the user choose a folder won't work if there are duplicate filenames. In that case, the move just won't complete. You have to handle the conflict and rename the dupes or they won't be moved.

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
LEGEND ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

After banging on this a bit, try this. It lets you choose a folder and auto-resolves duplicates. It works from a search or collection.

---------------------------------

#target bridge

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

    selItems = MenuElement.create('command', 'Move Items', 'at the end of Thumbnail');

    }

selItems.onSelect = function(){

    try{

        var thumbs = app.document.selections;

        if(thumbs.length < 1) return;

        var newFolder = Folder.selectDialog('Select Folder');

        if(newFolder == null) return;

        var foldT = new Thumbnail (newFolder);

        app.synchronousMode = true;

        for(var a in thumbs){

            if(thumbs.parent != foldT){

                var copyFile = File(newFolder.fsName + '/' + thumbs.name);

                if(!copyFile.exists){

                    thumbs.moveTo(newFolder);

                    }

                else{

                    var j = 1;

                    while(copyFile.exists){

                        var nSplit = thumbs.name.split('.');

                        ext = nSplit.pop();

                        thumbs.name = nSplit.join('.') +  ' (' + j + ')' + '.' + ext;

                        copyFile = File(newFolder.fsName + '/' + thumbs.name);

                        j = j + 1;

                        }

                    thumbs.moveTo(newFolder);

                    }

                }

            }

        app.synchronousMode = true;

        app.document.chooseMenuItem('Refresh');

        }

    catch(e){

        alert(e + e.line);

        }

    }

-------------------------------------------------

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
Community Beginner ,
Jul 28, 2020 Jul 28, 2020

Copy link to clipboard

Copied

Hey @Lumigraphics.
Thanks for the scripts, I was trying to find something like this. I wanted to ask if you could guide me on how to use this script once inside Bridge. I have installed it but I don't still know how to make it run.
I do see the "Move Items" command. As I click on it, rather than making a new folder, it opens a window to choose the location, and as I do that it says - "Reference Error: thumbs.moveTo is not a function33". Do let me know how to get resolve this.
Thanks!

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
LEGEND ,
Jul 29, 2020 Jul 29, 2020

Copy link to clipboard

Copied

Try this one instead.

#target bridge

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

selItems = MenuElement.create('command', 'Move Items', 'at the end of Thumbnail');

}

selItems.onSelect = function(){

try{

var thumbs = app.document.selections;
var a = 0;

if(thumbs.length < 1) return;

var newFolder = Folder.selectDialog('Select Folder');

if(newFolder == null) return;

var foldT = new Thumbnail (newFolder);

app.synchronousMode = true;

for(a = 0; a < thumbs.length; a++){

if(thumbs[a].parent != foldT){

var copyFile = File(newFolder.fsName + '/' + thumbs[a].name);

if(!copyFile.exists){

thumbs[a].moveTo(newFolder);

}

else{

var j = 1;

while(copyFile.exists){

var nSplit = thumbs[a].name.split('.');

ext = nSplit.pop();

thumbs[a].name = nSplit.join('.') + ' (' + j + ')' + '.' + ext;

copyFile = File(newFolder.fsName + '/' + thumbs[a].name);

j = j + 1;

}

thumbs[a].moveTo(newFolder);

}

}

}

app.synchronousMode = true;

app.document.chooseMenuItem('Refresh');

}

catch(e){

alert(e + e.line);

}

}

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
Community Beginner ,
Jul 30, 2020 Jul 30, 2020

Copy link to clipboard

Copied

Got it! It works. Thanks for sharing this @Lumigraphics! I also wished to discuss an alternative with you.
Initially, what I had in mind was a little different.
1. I have a folder, say - "XX" with some 100 hundred images.
2. I select a set of images I wish to move within the same Folder - "XX" in Bridge. (I use Bridge in this step as it has color tags and other metadata filters)
3. Press a script
4. It creates a new subfolder (within XX), say - "New Folder", and moves the selected images inside the subfolder.
5. I select another set images and continue the process so it creates - "New Folder (2)", "New Folder (3)".... and so on.

With your script, I have to choose the destination folder every time I wish to move a particular set of images, through the folder dialogue box. That is the one step I wish to automate.

Do you this that this is possible?

Thanks and Regards.

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
LEGEND ,
Jul 30, 2020 Jul 30, 2020

Copy link to clipboard

Copied

Yes you could modify it to use hard coded folder names in the parent folder. Sounds like a good exercise for learning about Bridge scripting ☺️

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
Community Beginner ,
Jul 31, 2020 Jul 31, 2020

Copy link to clipboard

Copied

Haha!
Sure does! Any recommendations on where to get started? For now, it all sounds greek to me..

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
LEGEND ,
Jul 31, 2020 Jul 31, 2020

Copy link to clipboard

Copied

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
New Here ,
Jan 08, 2024 Jan 08, 2024

Copy link to clipboard

Copied

Thanks for working on this. I can't seem to get it to show up in Mac Bridge 2024. I copied the code and saved it as .jsx, saved it into the Startup Scripts folder in Library>Application Support>Adobe>Bridge 2024 and restarted Bridge. It asked if I wanted to load it, and I said yes. Right-clicking doesn't show it, and neither does Tools.

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
LEGEND ,
Jan 09, 2024 Jan 09, 2024

Copy link to clipboard

Copied

With my script above, when you have items selected and right-click, there will be "Move Items" in the contextual menu.

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
New Here ,
Jan 09, 2024 Jan 09, 2024

Copy link to clipboard

Copied

LATEST

Oh. I'm dumb. I didn't realize that that feature wasn't always there. Thank you.

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