New Folder from selection

Is there a way to put selected files in a new folder, as I can do in Nautilus?

Not exactly sure what your asking , but you can always create a new folder and copy whatever files you want to it.

Sure, but with the “new Folder from selection” function, like in Nautilus, it would be easier and faster, specially with lots of files!

Caja doesn't natively support this feature, but you can create your own Caja Script to achieve similar functionality.

  1. Copy this into a new text file, save it to: ~/.config/caja/scripts/New Folder from Selection

    #!/bin/bash
    IFS='\n'
    paths="$CAJA_SCRIPT_SELECTED_FILE_PATHS"
    folder_name="$(zenity --entry --title='New Folder from Files' --text='What is the name of the folder?')"
    
    mkdir "$folder_name"
    while read -r path; do
        mv "$path" "$folder_name"
    done <<< "$paths"
    
  2. Right click the file → Properties → Permissions tab and mark as executable.

  3. Optionally give your new script an icon.

  4. You can now right-click a selection of files and make a new folder from the "Scripts" menu.

3 Likes

Hi @lah7, could you please tell me how you changed the color of your ‘close’ button? :slight_smile:

@Apollonius, I guess it’s one of these themes: Ambiance & Radiance Colors or Ambiance & Radiance Flat Colors :wink:

@lah7, thank you for the script!

It is the Ambiance Colors (and Flat) theme, I’m still on 16.04. :art:

@TommyDavid You’re welcome! :slight_smile:

1 Like