Reversing File Names

Advanced Renamer forum
#1 : 15/05-18 18:37
Pete
Pete
Posts: 2
I tried the suggested script to reverse file names:
function (index, item) {
var OldName = item.name;
var NewName = OldName.split('').reverse().join('');
return NewName;

But I get the following error: invalid script line 0: _itemFunc is not defined

Any suggestions?

Pete A


15/05-18 18:37
#2 : 15/05-18 23:28
Mark
Mark
Posts: 175
Reply to #1:
Did you get this from https://www.advancedrenamer.com/forum_thread?for um_id=1414

It works for me ... as does the single line Kim recommends;

return item.name.split('').reverse().join('');

(but both only work when "Apply to" is "Name")

I don't get error messages, and am using v3.82.

Can't help more than that, I'm afraid.


15/05-18 23:28
#3 : 16/05-18 04:42
Pete
Pete
Posts: 2
Thanks Mark for answering.

Yes, I used the script mentioned.

I might not have the settings correct.

I was going to attach a screen shot, but I don't see anyway to do that here.

I am not a beginner, I have been programming sense 1962.

I have tried simple replace scripts and get the same error.

I may have the wrong setting. Is there any tutorial on how to make scripts work.

Thanks in advance.

Pete



16/05-18 04:42
#4 : 16/05-18 09:48
Mark
Mark
Posts: 175
Reply to #3:
1962 ..... a fine year! The Year I was born :)

I do not use the scripting, so I cannot help directly.

The only AR "tutorial" I know of is in the User Guide, https://www.advancedrenamer.com/user_guide/compl ete_guide#page_example_scripting

You may want to email Kim directly via https://www.advancedrenamer.com/support

Mark


16/05-18 09:48