Folder Copy w/sub levels.

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
timhatz
Posts: 41
Joined: 12 Dec 2008 06:21

Folder Copy w/sub levels.

Post by timhatz »

I was able to do a folder only copy, but it did not build the sub folders in that folder, is there a way to tell XY to copy these folders and any subfolders, but not the actual files in the folders.


Thanks, Tim

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: Folder Copy w/sub levels.

Post by nas8e9 »

timhatz wrote:I was able to do a folder only copy, but it did not build the sub folders in that folder, is there a way to tell XY to copy these folders and any subfolders, but not the actual files in the folders.


Thanks, Tim
From the help file:
To do a Rich Copy, drag the selected files from the find results list to the destination in Tree using the right mouse button: on drop, a popup menu will give you the choice between normal and rich operations.
The popup menu will show the command Create Branch(es) Here; that should do it.

tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Re: Folder Copy w/sub levels.

Post by tomuser »

Paste Special->Paste Folder Structure

admin
Site Admin
Posts: 64877
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Folder Copy w/sub levels.

Post by admin »

nas8e9 wrote:
timhatz wrote:I was able to do a folder only copy, but it did not build the sub folders in that folder, is there a way to tell XY to copy these folders and any subfolders, but not the actual files in the folders.
From the help file:
To do a Rich Copy, drag the selected files from the find results list to the destination in Tree using the right mouse button: on drop, a popup menu will give you the choice between normal and rich operations.
The popup menu will show the command Create Branch(es) Here; that should do it.
Note that Rich Copy is only for search results.

Create Branch(es) Here is probably what you want (drag'n'drop context menu).

Or, copy the folder to the clipboard (select folder, then Ctrl+C), then goto the target and do menu Edit / Paste Special / Paste Folder Structure.

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: Folder Copy w/sub levels.

Post by nas8e9 »

admin wrote:Note that Rich Copy is only for search results.

Create Branch(es) Here is probably what you want (drag'n'drop context menu).

Or, copy the folder to the clipboard (select folder, then Ctrl+C), then goto the target and do menu Edit / Paste Special / Paste Folder Structure.
@admin and @tomuser: thank you. I suffered a case of being in the general vicinity but no nearer than that :mrgreen:.

timhatz
Posts: 41
Joined: 12 Dec 2008 06:21

Re: Folder Copy w/sub levels.

Post by timhatz »

Paste folder structure worked great. Thank you!

GamaRex
Posts: 51
Joined: 13 Jan 2010 22:04

Re: Folder Copy w/sub levels.

Post by GamaRex »

Is it possible to copy the folder structure to the clipboard to paste as text? I'd like to keep a record of folder structure, and possibly add it to multiple drives using the New Folders dialog. I would want to copy the paths using folders rather than files, since I'd want unique results, not a folder for each file found or selected. Thanks.

admin
Site Admin
Posts: 64877
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Folder Copy w/sub levels.

Post by admin »

GamaRex wrote:Is it possible to copy the folder structure to the clipboard to paste as text? I'd like to keep a record of folder structure, and possibly add it to multiple drives using the New Folders dialog. I would want to copy the paths using folders rather than files, since I'd want unique results, not a folder for each file found or selected. Thanks.
Yes, run this script line through the address bar:

Code: Select all

folderreport("dirs", "clipboard", ,"r");
It will copy a report of the current folder structure to the clipboard. Returned are absolute paths. To use it in the New Folders dialog you will have to edit the result (cut the left ends to get relative paths).

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Folder Copy w/sub levels.

Post by Stefan »

admin wrote:
GamaRex wrote:Is it possible to copy the folder structure to the clipboard to paste as text? I'd like to keep a record of folder structure, and possibly add it to multiple drives using the New Folders dialog. I would want to copy the paths using folders rather than files, since I'd want unique results, not a folder for each file found or selected. Thanks.
Yes, run this script line through the address bar:

Code: Select all

folderreport("dirs", "clipboard", ,"r");
It will copy a report of the current folder structure to the clipboard. Returned are absolute paths. To use it in the New Folders dialog you will have to edit the result (cut the left ends to get relative paths).
More complete example:

Code: Select all

$colFullPath = folderreport("dirs", "r", , "r");
   $colRelativePath = replace($colFullPath, "<curpath>\");
        msg $colRelativePath;
        copytext $colRelativePath; //to clipboard

admin
Site Admin
Posts: 64877
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Folder Copy w/sub levels.

Post by admin »

The latest BETA v9.90.0505 has this:

Code: Select all

folderreport("dirsrel", "clipboard", , "r");

GamaRex
Posts: 51
Joined: 13 Jan 2010 22:04

Re: Folder Copy w/sub levels.

Post by GamaRex »

I'm afraid I'm in new territory here. This sounds like what I want to do, but I get only errors when I try either script.

I pasted the first code into the address bar and clicked Address Bar Go:
folderreport("dirs", "clipboard", ,"r");
I get an error:

The location or item you have selected could not be found:
D:\Program Files\XYplorer\folderreport("dirs", "clipboard", ,"r");

I tried the other example, pasting it into Run Script

$colFullPath = folderreport("dirs", "r", , "r");
$colRelativePath = replace($colFullPath, "<curpath>\");
msg $colRelativePath;
copytext $colRelativePath; //to clipboard

and it gives an error:
folderreport("dirs", "r", , "r");

I'm using version 9.80.0100.

I assume I'm missing a variable or some other essential script element. I'm sure the problem is in my ignorance of scripting.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Folder Copy w/sub levels.

Post by Stefan »

@GamaRex

1.
i can't explain the whole story well right now, but you have to prefix the
addressbar script by two colons:

Code: Select all

Address bar [::folderreport("dirs", "clipboard", ,"r");    ]
2.
for an script you have to know the rules.
f.ex.: all lines after the first one have to be indented (your script should looks like mine)


HTH?

admin
Site Admin
Posts: 64877
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Folder Copy w/sub levels.

Post by admin »

Ah, mea culpa!! I forgot the :: at the beginning:

Code: Select all

::folderreport("dirsrel", "clipboard", , "r");

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Folder Copy w/sub levels.

Post by Stefan »

GamaRex wrote: I'm using version 9.80.0100.
I can't say for sure, but this could the problem... folderreport() is relative new implemented.

Check out the XY history.

EDIT:

Code: Select all

v9.90.0205 - 2011-02-04 12:38
    * SC folderreport enhanced:
        type:
          dirs: List of subfolders 
Last edited by Stefan on 20 Mar 2011 17:45, edited 1 time in total.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Folder Copy w/sub levels.

Post by j_c_hallgren »

GamaRex wrote:I'm using version 9.80.0100.

I assume I'm missing a variable or some other essential script element. I'm sure the problem is in my ignorance of scripting.
9.80.0100 in XY terms is starting to get close to ancient history!

When possible, always use the latest beta, ok? That's always the best thing to try here...though I see that Don has admitted a minor 'oops'.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Post Reply