File2Folder-like function in XY

Features wanted...
Post Reply
chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

File2Folder-like function in XY

Post by chumbo »

I've been using a small script for Windows called File2Folder that does exactly that, creates a folder for 1 or more files and puts those files in that newly-created folder.
There is no GUI, it just creates a single context-menu which, when you select a file and run it, will create a folder based on the name of the file and instantly put that file in that new folder.
If you run it on two or more files, then a menu pops up giving you the option to either move each file to it's own folder - again based on the name of those individual files - or move them all into one folder for which you then can enter a name...that's it!
Simple, super useful and used to work until I recently bought a new PC and I guess with a new version of Windows it has stopped working (confirmed by other users as well) :(

Wouldn't this be possible to do in XY?

Here's the link to the developer's website: https://www.dcmembers.com/skwire/downlo ... -2-folder/
It's his 2nd most downloaded app after....Text2Folder which pretty much already exists in XY as 'New Folders...' context-menu which is why I think this could be a great addition many will find useful! :)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: File2Folder-like function in XY

Post by highend »

And? Write a simple script for it, use a CEA to get a menu entry on right click for it^^
One of my scripts helped you out? Please donate via Paypal

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: File2Folder-like function in XY

Post by chumbo »

highend wrote: 25 May 2022 10:54 And? Write a simple script for it, use a CEA to get a menu entry on right click for it^^
Haha, I wish I could (funny how these days everybody assumes one is coder ;)), otherwise, be sure I'd have done so and shared it for all to enjoy!

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: File2Folder-like function in XY

Post by RalphM »

Well, standard XY functions already offer to right-drag the selected files to any location (including the current folder) and select move/copy to new subfolder and it then offer the name of the focused file as name for the new folder.
The only thing you are missing of your original request is the part where each file ends up in its own folder.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

VeeGee

Re: File2Folder-like function in XY

Post by VeeGee »

Good morning ! Here is a script that I use in the Hamburger menu. It will "get" a folder name based on the selected file(s), display a preview and, if OK, move the file(s) to the folder(s). I had created an original version and then highend helped me optimize it.

I saved the script into the (\AppData\Roaming\XYplorer\Scripts) folder.
Hamburger menu code :

Code: Select all

::Move File to Folder;load "MoveFileToFolder.xys";
It might not be exactly what you are asking for, but I hope this helps out and can get you started.
Attachments
MoveFileToFolder.xys
(270 Bytes) Downloaded 67 times
Last edited by VeeGee on 25 May 2022 14:20, edited 2 times in total.

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: File2Folder-like function in XY

Post by chumbo »

Thx VeeGee but unfortunately I couldn't get it to work as you described. I don't know what is the Hamburger Menu (briefly looked in the Help...unsurprisingly, I didn't understand anything :(), so I just ran the script with some files selected and it just opened the 'Rename' function in XY?

Thx RalphM! That's already half of the functionality taken care of! :appl:

VeeGee

Re: File2Folder-like function in XY

Post by VeeGee »

Hello !
The hamburger menu is the small three-lined icon on the breadcrumb bar :
Image-001.png
Image-001.png (2.69 KiB) Viewed 2264 times
You can put all kinds of useful commands and scripts in the menu. You right-click, Customize to be able to edit it. IMO, it ranks up there and one of the best additions to XY ever.

I do have the script set (via the preview setting) to display the rename preview box so I can verify that it is correct. This can be disabled by changing this line :

Code: Select all

rename "l", $list, "p", $items, 193
to

Code: Select all

rename "l", $list, , $items, 193
More qualified scripting gurus may jump in and help out here, this is just my simple take on it.

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: File2Folder-like function in XY

Post by FluxTorpedoe »

Hi chumbo,

I had the same need so it was one of the first scripts I made a while back — it’s indeed an incredibly useful function, I use it all the time without even thinking about it!

I wanted it as efficient as possible, so it’s just:
Select file(s) > Shift+F (my shortcut) > Done!

There’s no Right-Click or multiple choices, but you can build on it.

Hope this helps,

Flux

———————————————————————————
###   Folderize   ###

• DOWNLOADS:
› Script:
_Manip_Folderize.xys
(1.63 KiB) Downloaded 66 times

• INSTALLATION:
 — Download the script (link above) and copy it into XYplorer scripts folder: <xyscripts> , then
 — Assign a shortcut to it (e.g. for Shift+F):
   XYplorer menu User > Manage Commands... > Load Script File > [New] > Add New Command >
   Caption: Folderize
   Script File: _Manip_Folderize.xys
   > [Assign Keyboard Shortcut] > Shift+F

• HOW TO USE:
 — Select one or more files
 — Press the assigned keyboard shortcut, e.g. Shift+F
 > A new folder will be created (based on the focused file) and all selected files will be moved inside it.

› Tip: Since the name of the focused file is used for the name of the folder, it’s possible to first select a specific file to focus it, then (without pressing any modifier) just lasso around the group of files (the focused file will be distinguished by its dotted frame).

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: File2Folder-like function in XY

Post by chumbo »

Brilliant Flux, thx! But if I may say without wanting to offend...this is sort already built-in XY as was explained by RalphM a few posts above.
Agreed your script can be faster by skipping the folder naming window that pops-up with the right-drag but what's still really missing and equally useful is the ability to create multiple folders from multiple files (each folder carrying the name of it's corresponding file).
You never needed that? Highend made a sound like a really simple task for someone who knows how to code so...dunno if you're up to the task, if you find it useful? ;)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: File2Folder-like function in XY

Post by highend »

Last one I've shared
1.png
1.png (26.11 KiB) Viewed 2245 times
One of my scripts helped you out? Please donate via Paypal

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: File2Folder-like function in XY

Post by chumbo »

Thx...I guess :veryconfused: ??
I imagine someone will know what to do with this :roll:

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: File2Folder-like function in XY

Post by Filehero »

@highend
Is this VSCode?

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: File2Folder-like function in XY

Post by highend »

Sublime Text
One of my scripts helped you out? Please donate via Paypal

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: File2Folder-like function in XY

Post by Filehero »

Thanks.

Post Reply