Does anyone have a script that does this...

Discuss and share scripts and script files...
Post Reply
Vocalpoint
Posts: 163
Joined: 06 Nov 2009 14:01

Does anyone have a script that does this...

Post by Vocalpoint »

If I do this:

Highlight one (or many files) in any random directory

Is there a script out there for XY to do this:

Create a new folder (in the directory where the files are) named with today's date in this format (MM-DD-YYYY)
Move all highlighted files to this newly created directory

Appreciate any assistance.

Cheers!

VP

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

Re: Does anyone have a script that does this...

Post by highend »

new()
moveto()
One of my scripts helped you out? Please donate via Paypal

Vocalpoint
Posts: 163
Joined: 06 Nov 2009 14:01

Re: Does anyone have a script that does this...

Post by Vocalpoint »

highend wrote: 06 Oct 2021 15:22 new()
moveto()
Highend

I get the basics of what are getting at but how does this take "selected" files into context? If I have 40 files in the directory and only highlight 4 of them - I only want those four to go into a folder with today's date.

I found this snippet in the forum:

$SelectedItems = get("SelectedItemsPathNames", "|");
moveto "<date mm-dd-yyyy>", $SelectedItems;

But when test it (via Test Script) - it does nothing?

Cheers

VP
Last edited by Vocalpoint on 06 Oct 2021 16:45, edited 1 time in total.

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

Re: Does anyone have a script that does this...

Post by highend »

moveto() help entry?
source [optional] The item(s) that will be copied or moved. Alternatively it can point to the source control (":tree", ":list", or ":catalog"), or to a text file containing a list of source items ("*filename"; see below).
If missing then the selected items of the focused control (List, Tree, Catalog) are used.
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1123
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: Does anyone have a script that does this...

Post by yusef88 »

just as a tip you can select files, press (Ctrl+Shift+X) and choose date from drop down menu
Attachments
2021-10-06_182117.png
2021-10-06_182117.png (8.84 KiB) Viewed 1759 times

Vocalpoint
Posts: 163
Joined: 06 Nov 2009 14:01

Re: Does anyone have a script that does this...

Post by Vocalpoint »

yusef88 wrote: 06 Oct 2021 18:32 just as a tip you can select files, press (Ctrl+Shift+X) and choose date from drop down menu
Except I would need to have every relative date (potentially 365) at the ready on the drop down. I do not want to have to type anything and need it to work on the fly.

BTW: I finally have some working code (and it's quite simple):

foreach($item, "<get SelectedItemsPathNames |>") {
moveto "<date mm-dd-yyyy>", $item, , 2;
}

Cheers!

VP

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

Re: Does anyone have a script that does this...

Post by highend »

Apart from that it doesn't make much sense to create a date on each loop, a simple
moveto "<date mm-dd-yyyy>", , , 2;
does the exact same thing

Can you please put code into BBCode tags?
One of my scripts helped you out? Please donate via Paypal

Vocalpoint
Posts: 163
Joined: 06 Nov 2009 14:01

Re: Does anyone have a script that does this...

Post by Vocalpoint »

highend wrote: 06 Oct 2021 19:13 Apart from that it doesn't make much sense to create a date on each loop, a simple
moveto "<date mm-dd-yyyy>", , , 2;
does the exact same thing

Can you please put code into BBCode tags?
Even better!

And how exactly do I put the code in BBCode tags within this editor? Is it the Code Display button?

Thanks!

VP

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

Re: Does anyone have a script that does this...

Post by highend »

1.png
1.png (15.64 KiB) Viewed 1728 times
One of my scripts helped you out? Please donate via Paypal

Vocalpoint
Posts: 163
Joined: 06 Nov 2009 14:01

Re: Does anyone have a script that does this...

Post by Vocalpoint »

highend wrote: 06 Oct 2021 19:261.png
Thanks!

Will remember for next time.

Thanks for the help today.

Cheers!

VP

Post Reply