Moving files to folders - Bug or Limitation
Hi Folks,
I have a group of files such as:
- "Screenshot 2026-04-16 at 12.33.36.png"
- "Screenshot 2026-04-17 at 16.38.55.png"
I'd like to move them to a folder using the date shown within the file name (not the file created/modified timestamps).
I can setup a method using Replace and Add to generate new file names of:
- "2026-04-16/Screenshot 2026-04-16 at 12.33.36.png"
- "2026-04-17/Screenshot 2026-04-17 at 16.38.55.png"
However, I get an error ":/ is not supported in filenames".
Is this a product limitation or a bug? I'm using MacOS so is the tool incorrectly interpreting \ as a / or does it just not allow the output to split names into folder/names etc?
This is just a simple example, but should hopefully illustrate my issue. I actually want to do this for folder names rather than file names, and have much more complex requirements where I'm reordering parts of folder names and creating a structured folder hierarchy. I don't want to use a script to do this as I might as well have just written a Python app by that point, I'm trying to keep it simple and GUI driven. I can do this in Transnomino but that app only works on files rather than folders, so it's slow with lots of files and the file list gets rather unnecessarily cluttered making it difficult to verify the output path is correct.
Thanks.
I have a group of files such as:
- "Screenshot 2026-04-16 at 12.33.36.png"
- "Screenshot 2026-04-17 at 16.38.55.png"
I'd like to move them to a folder using the date shown within the file name (not the file created/modified timestamps).
I can setup a method using Replace and Add to generate new file names of:
- "2026-04-16/Screenshot 2026-04-16 at 12.33.36.png"
- "2026-04-17/Screenshot 2026-04-17 at 16.38.55.png"
However, I get an error ":/ is not supported in filenames".
Is this a product limitation or a bug? I'm using MacOS so is the tool incorrectly interpreting \ as a / or does it just not allow the output to split names into folder/names etc?
This is just a simple example, but should hopefully illustrate my issue. I actually want to do this for folder names rather than file names, and have much more complex requirements where I'm reordering parts of folder names and creating a structured folder hierarchy. I don't want to use a script to do this as I might as well have just written a Python app by that point, I'm trying to keep it simple and GUI driven. I can do this in Transnomino but that app only works on files rather than folders, so it's slow with lots of files and the file list gets rather unnecessarily cluttered making it difficult to verify the output path is correct.
Thanks.
Hi Richard,
I don't know about MacOS, but you can't create folders that way. It can be done using the MOVE or COPY batch modes, though; in your case the "Output folder:" specification could be
<word:2>-<word:3>-<word:4>\
I say *could* be because there are likely other strings you could use, btw.
As an aside, I have to say, Javascript methods don't have to be all that complicated. The same result can be more universally achieved by using this two-line script:
t = item.newBasename.replace(/.* (\d+-\d+-\d+) .*/, "$1" ) ;
item.newPath = item.path + t ;
It just looks for the first instance of [numbers]-[numbers]-[numbers] and adds that string to the path. Doing it this way means you can use almost any combination of methods to manipulate the filenames; the assignment to a new path-string can happen anywhere in your method list that you'd like it to happen (instead of wherever ARen wants to do it in the MOVE/COPY batch). By changing the regular expression in the replace line you can easily specify what you'd like to be in your path-string. And the MOVE/COPY batch modes don't allow regex in the Output field.
Batch modes: https://www.advancedrenamer.com/user_guide/v4/batchmode
Hope this helps; if not, maybe somebody Mac-aware can be of more assistance.
Best,
DF
I don't know about MacOS, but you can't create folders that way. It can be done using the MOVE or COPY batch modes, though; in your case the "Output folder:" specification could be
<word:2>-<word:3>-<word:4>\
I say *could* be because there are likely other strings you could use, btw.
As an aside, I have to say, Javascript methods don't have to be all that complicated. The same result can be more universally achieved by using this two-line script:
t = item.newBasename.replace(/.* (\d+-\d+-\d+) .*/, "$1" ) ;
item.newPath = item.path + t ;
It just looks for the first instance of [numbers]-[numbers]-[numbers] and adds that string to the path. Doing it this way means you can use almost any combination of methods to manipulate the filenames; the assignment to a new path-string can happen anywhere in your method list that you'd like it to happen (instead of wherever ARen wants to do it in the MOVE/COPY batch). By changing the regular expression in the replace line you can easily specify what you'd like to be in your path-string. And the MOVE/COPY batch modes don't allow regex in the Output field.
Batch modes: https://www.advancedrenamer.com/user_guide/v4/batchmode
Hope this helps; if not, maybe somebody Mac-aware can be of more assistance.
Best,
DF
Reply to #2:
Sorry, a small edit. [EDIT: I screwed this edit up. I'm changing it now to reflect reality. See, I'm really just an AI and I hallucinate like any respectable machine... :) ]
The script can be made more versatile by leaving out the space before (\d+-\d+-\d+)
so the script becomes:
t = item.newBasename.replace(/.*(\d+-\d+-\d+) .*/, "$1" ) ;
item.newPath = item.path + t ;
Cheers, [sorry again!]
DF
Sorry, a small edit. [EDIT: I screwed this edit up. I'm changing it now to reflect reality. See, I'm really just an AI and I hallucinate like any respectable machine... :) ]
The script can be made more versatile by leaving out the space before (\d+-\d+-\d+)
so the script becomes:
t = item.newBasename.replace(/.*(\d+-\d+-\d+) .*/, "$1" ) ;
item.newPath = item.path + t ;
Cheers, [sorry again!]
DF
Reply to #3:
Excellent, love the hallucinations, many thanks for your feedback. I had tried the <Word> option but the resulting folder could be 1 or more words and I needed the ability to pick x number of words between 2 known characters etc.
With a bit of tweaking a script using your item.newBasename example has worked great thanks :-)
It would be great if at some point in the future Advanced Renamer could simply allow users to include folder separators in the standard renaming methods and obtain the same result, but for now I'll keep a note of the script and use that for future projects.
Excellent, love the hallucinations, many thanks for your feedback. I had tried the <Word> option but the resulting folder could be 1 or more words and I needed the ability to pick x number of words between 2 known characters etc.
With a bit of tweaking a script using your item.newBasename example has worked great thanks :-)
It would be great if at some point in the future Advanced Renamer could simply allow users to include folder separators in the standard renaming methods and obtain the same result, but for now I'll keep a note of the script and use that for future projects.
Reply to #4:
Hi Richard,
[Sorry, DF is busy doing a system update at the moment. It will be back online soon...]
Seriously though, :) Glad I could be of some help. I will say that with the recent addition of "Append method list file" to the Load method list menu, it's a lot easier to deal with code or method snippets like that script. Just save it as a separate Method batch and append it to whatever you need it for.
I've been using ARen for over 12 years, and in that time Kim has added so much great stuff. "Advanced" is in the name, so it's not the easiest program to use, but if you put in a little time it can do almost anything needed in the mass renaming space. It would not surprise me to see your request added in the future. :)
Oh, and feel free to share your tweaks with other users as you can...
Best,
DF
Hi Richard,
[Sorry, DF is busy doing a system update at the moment. It will be back online soon...]
Seriously though, :) Glad I could be of some help. I will say that with the recent addition of "Append method list file" to the Load method list menu, it's a lot easier to deal with code or method snippets like that script. Just save it as a separate Method batch and append it to whatever you need it for.
I've been using ARen for over 12 years, and in that time Kim has added so much great stuff. "Advanced" is in the name, so it's not the easiest program to use, but if you put in a little time it can do almost anything needed in the mass renaming space. It would not surprise me to see your request added in the future. :)
Oh, and feel free to share your tweaks with other users as you can...
Best,
DF