'Cloning the current item' for multiple selections
-
kiwichick
- Posts: 676
- Joined: 08 Aug 2012 04:14
- Location: Windows 10 Pro 22H2, 150% scaling
'Cloning the current item' for multiple selections
Hi there, I've come across the 'Cloning' command in the Help File which is AWESOME because I do that kind of thing heaps. But it only works on one selected item (even if multiple items are selected). How do I get it to work for multiple selections? Cheers.
Windows 10 Pro 22H2
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: 'Cloning the current item' for multiple selections
Yes the command "new" works for one item at a time only, use foreach loop instead something like:kiwichick wrote:Hi there, I've come across the 'Cloning' command in the Help File which is AWESOME because I do that kind of thing heaps. But it only works on one selected item (even if multiple items are selected). How do I get it to work for multiple selections? Cheers.
Code: Select all
//Clone selected items
foreach($item, <get SelectedItemsPathNames |>){
new(, , "$item");
}
-
kiwichick
- Posts: 676
- Joined: 08 Aug 2012 04:14
- Location: Windows 10 Pro 22H2, 150% scaling
Re: 'Cloning the current item' for multiple selections
Thanks heaps, serendipity!! I had managed to get a 'clone' script semi-working with a foreach loop but I had part of the 'new' command wrong. I did manage to achieve the same result I was after by using this code:
So, what is the difference between 'cloning' and 'copying' an item? Cheers.
Code: Select all
copyas "*.?";So, what is the difference between 'cloning' and 'copying' an item? Cheers.
Windows 10 Pro 22H2
XYplorer Beta Club