What's wrong, button:
Copy MOVE HERE CreateFolder Name="{createddate|yyyy}"
Many thanks
opusfreak
What's wrong, button:
Copy MOVE HERE CreateFolder Name="{createddate|yyyy}"
Many thanks
opusfreak
CREATEFOLDER does not require Name parameter. As per the docs, syntax is CREATEFOLDER "Name of the folder"createddate is not a valid variable name. You'd need to compute the creation date of the selected file.I've been looking if this was possible using the evaluator, but it does not seem to be the case since createddate seems to be valid only in an evaluator column context.
If I were to do it, I'd go for a script button ... but maybe someone has a more elegant way of doing it without reverting to scripting.
How about renaming?
Yeah ! That's what I thought first. Then moved on.
Evaluator column variables are supposed to be usable from a rename context ... but I'm definitely not into evaluator
. Every time I try and use it, I end up spending way too much time and have to give up most of the time.
FWIW, a script button version until someone else comes and gives a oneliner !!! ![]()
function OnClick(clickData)
{
var cmd = clickData.func.command;
if (clickData.func.sourcetab.selected.count == 0)
{
DOpus.Output("No selection. Doing nothing.");
return;
}
for (var e = new Enumerator(clickData.func.sourcetab.selected); !e.atEnd(); e.moveNext())
{
var item = e.item();
if (item.is_dir)
{
DOpus.Output("'" + item.RealPath + "' is a folder. Ignoring.");
continue;
}
var createYear = item.create.Format("D#yyyy");
cmd.RunCommand('Copy Move HERE "' + item.realpath + '" CREATEFOLDER "' + item.path + "\\" + createYear + '"');
}
// --------------------------------------------------------
}
How about :
Rename PATTERN="*" TO="{{created|D#yyyy}\*" IGNOREEXT
or maybe:
Rename PATTERN="*" TO="$.\{{created|D#yyyy}\*" IGNOREEXT
if you want to move them at the base folder.
But the topic is very ambiguous, it does not say that folders should be ignored like in your example. If that is the case, then yes, I imagine Evaluator or scripting would be required. In the latest releases, Evaluator has gained the ability to do loops, get items, and more, so it would be a good candidate.
[I also think it would be great if the forum had its own section with curated examples (like small snippets) for commands, scripting, and Evaluator, since the documentation lacks examples. That way you would not have to search all over the forum every time you need inspiration.]
I have this button that I have used in the past to begin archiving photos with no exif data.
I don't remember at all where I got the code, but it works .
This does similar to the thread topic with modified date.
Rename REGEXP PATTERN (.*) TO {modifieddate|D#yyyy-MM-dd}\\\0 FILEINFO autorename
Really, I need to rethink this first, but it may be a step in the right direction here.
This code may be obsolete. Do we need FILEINFO at all any more ?
I don't know at the moment.
Support++ @errante suggestion where the "forum had its own section with curated examples (like small snippets) for commands, scripting, and Evaluator."
That's what the Buttons & Scripts and Rename Presets areas are for.