Nemo: [Feature Request] New Folder from Selection

Created on 21 Mar 2014  路  10Comments  路  Source: linuxmint/nemo

Some of my friends told me that there is a function call "New Folder from Selection" is coming in the new nautilus, it acts like following:
For example, files in folder: Pic01,Pic02,...,Pic10 ; after select these files and right click them, the "New Folder from Selection" in menu will make a folder called "Pic"(some common name from these files) and move all selected files into this folder.
In order to do so,I make a nemo-actions:
Name=Put them into same folder
Exec=
Quote=double

Code in this python:

!/usr/bin/env python3

import os
import sys
from time import time,localtime,strftime
import shutil

time-tag as the default folder name if the foldername is exist, better solutions?

DefPath=strftime("%Y-%m-%d_%H-%M-%S",localtime(time()))
AllPath=[]
for i in sys.argv[1:]:
AllPath.append(i)
CommonPath=os.path.commonprefix(AllPath)
isExists=os.path.exists(CommonPath)
if not isExists:
pass
else:
CommonPath=os.path.join(CommonPath,DefPath)

move selected files to the target folder

os.makedirs(CommonPath)
for i in sys.argv[1:]:
shutil.move(i,CommonPath)

I just learned python this month, so I think there must be someone can make it better.

FEATURE REQUEST

Most helpful comment

Let's say it is a media directory and there are about 50 folders in there and 200 files. Down at the letter s you have tree files you would like to put in a folder. Making a new folder will place this at the letter N amongst fhe folders. Even naming it the same as the files will group it amongst the folders. It is messy.

All 10 comments

:+1: for this feature, would be much useful for me arranging stuff in my Downloads folder. Eg: Move all *srt files into folder called subtitles. It works in the version of Nautilus I recently installed on Cinnamon. Although, the new folder name in my case was just "New Folder"

:+1:

+1

@JosephMcc, can we mark the issue as a feature request?

I'd imagine it like this: I select a couple of items in a folder. Right-click and choose something like "move to new folder". This action will make a new folder, move the files into it and let's me name that folder. Miss this function very much!

'd imagine it like this: I select a couple of items in a folder. Right-click and choose something like "move to new folder". This action will make a new folder, move the files into it and let's me name that folder. Miss this function very much!

Not sure how this is really saving you much over right-click->new folder, drag and drop the files to it.

Let's say it is a media directory and there are about 50 folders in there and 200 files. Down at the letter s you have tree files you would like to put in a folder. Making a new folder will place this at the letter N amongst fhe folders. Even naming it the same as the files will group it amongst the folders. It is messy.

Fair point.

Many thanks for contributing to Nemo. Your suggestion was reviewed.

For more information on our workflow and feature requests, read https://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/faq.html.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blueray453 picture blueray453  路  5Comments

Enkouyami picture Enkouyami  路  7Comments

Hairybiker picture Hairybiker  路  5Comments

teo1978 picture teo1978  路  5Comments

DominicMe picture DominicMe  路  4Comments