[scripting] How do you determine acted-upon files?

Hi

How can I determine what files were actually acted upon by a DO command?

Say there is a button that does:

RENAME PRESET="my_scripted_rename"
my_script_command_that_does_smth_else

How can I determine in my_script... what files/dirs were actually affected by RENAME?

My idea for now is using Func.Command.Vars in RENAME script to remember changes (is it even available in rename script?), but maybe there is some more direct way to do this?

See the item.failed property.

In case you need an example:
The "LogCommand" add-in, which logs general activities and their result, should provide some line of code to sneek at.

Example:

var command = "Rename .. "; //your command here data.func.command.RunCommand(command); var itemsEnum = new Enumerator(data.func.command.files); for(;!itemsEnum.atEnd();) { var item = itemsEnum.item(); itemsEnum.moveNext(); var status = "successful" if (item.failed) { status = "failure"; //command failed on item } }

This seems to work well if you act upon selected files (ie. command has filled items). After all I am going to remember changed files in global variable, as I have currently problems with constructing data in command object because of failing ReadDir in python.