add new files to a directory with numbered files

Advanced Renamer forum
#1 : 04/10-13 09:35
werner
werner
Posts: 6
Hi!
First - thank you for releasing this great software as freeware.

beside other things (which work fine) I tried to solve following problem:

I catalogue pictures in folders - the files should be named foldername_0001, foldername_0002.....
no problem so far.
but I often have to add some new pictures to one of these folders - and now they should fill the gaps or get the next numbers above the highest existing one.

unfortunately I can not renumber the whole directory (because of my backup-software - which will get confused).

I tried to do this with a script, but in the prebatch (although the app.getitem(1) gets no error) the item.path is not accessable.
(i tried to get the available numbers in the prebatch to store them in an array and access the array from the script if I notice that a file is not named like foldername_####.) - I don't think it would be performant - if I search for the next free number with every new file.

Do you have any idea to solve this problem? - and do your renamer only rename files wich names have changed or all files in the list.

thank you
werner


04/10-13 09:35
#2 : 07/10-13 09:07
Kim Jensen
Kim Jensen
Administrator
Posts: 870
Reply to #1:
That is not an easy task. But I think it is doable. Try to use this script:
http://www.advancedrenamer.com/down/forum/fill_ number_gaps.aren

It will rename all the files not matching the pattern and give them new names that fit into the gaps.


07/10-13 09:07
#3 : 08/10-13 09:30
werner
werner
Posts: 6
Hi!
Thank you very much for your reply (and for doing my work)
my fault was to try :
app.getitem(#) and then item.property....
instead of app.getitem(#).property

Your script works fine - sometimes ;)
Sometimes advanced renamer hangs up (after the window analyzing files.. dissapears with : Status testing names.. )
and I don't know why(so far)
first I thought it depends on the number of files -
but after the script runs for 250 ok and freezes by trying to rename 100 files thze next time(after clearing the list)
- this can not be the reason.
(I also tried to shut down renamer after every rename-attemp but this did not change anything).
At this time I can only say that I was not able to run it for 1200 files so far -
up to 300 it works sometimes - sometimes not, with less than 20 files it never freezes so far.

Until now I used this script on my internet-machine(XP) and a win7 mid-range-laptop.
I will try to run it on my gaming-PC(Win7 x64) - maybe today (perhaps it depends on memory or acces-time to the filesystem).

I will try to find out in which cases the script freezes an will tell it to you if I find out something.

During testing the script I noticed 2 little things:
Renaming method list : presets-toolbar not visible if laguage is deutsch
start directory (add files) is always the last directory before closing the program - not the last in use

and last - maybe you can add the option "unmark files that have not changed their name" to the other mark/unmark-options
in a further release -
so I do not have to do this manually (i do not want to rename 1200 files only by adding 10 new files) ?

thank you once more - and I hope I do not waste your time for a (maybe) rare used feature of your great software

werner


08/10-13 09:30
#4 : 08/10-13 12:13
werner
werner
Posts: 6
Additional info:

if I only run the prebatch (in the script only return item.name) with 1200 files in the list(= all files of this folder) -> no problem

if i only check 2 of these files (same folder, all files in the list) and run the whole scrip --> freeze (although this two
files don't change and so only the regex statement is executed .

If I take only a few files of the same folder into the list an run the whole script -> no problem.

Additional question: you do not sort the array in the prebatch -> are the items already sorted ascending name the first time ?
(as I noticed - after sorting another column in the filelist the app.getitem gets the items in the new order).


08/10-13 12:13
#5 : 08/10-13 19:00
Kim Jensen
Kim Jensen
Administrator
Posts: 870
Reply to #4:
Are you running the latest version of Advanced Renamer? Previous version were very buggy when executing scripts.


08/10-13 19:00
#6 : 09/10-13 06:36
werner
werner
Posts: 6
Reply to #5:

I'm using aren 3.60.

Yesterday I tried to run the script on my gaming-PC - same problem.

Depending the presets-toolbar: it is visible in german too, but it's not shown if the window-frame is too small.


New try:

I wrote a new script - finding the available numbers in the prebatch and use them in the script-part.
(If you want - I'll send them to you via email).
I workes more often than the original-script(sometimes with 1200 files, somtimes it fails with 370 files) , but if I only change little things in the script (removing test-variables) - the same script fails much more often (all with the same 6 Folders that contain between 50 and 1200 files).
I can not see any rules when the scripts fail and when it don't.


09/10-13 06:36 - edited 10/10-13 12:57
#7 : 11/11-13 08:21
werner
werner
Posts: 6
Reply to #6:
Is there a new version of the scripting-engine planned in a future release? - It seems, there is no workaround for the program-freeze.


11/11-13 08:21