Longshot: Are you running the script from the User folder or the
Application folder? The Application folder sometimes has higher privileges.
Certainly from the user folder. I will give a try with the application folder.
Thanks for the hint. I com back to you as soon as I have some feddback.
If this is a generic approach, then don't assume that Mac is too easy. I've had incidents where a folder on a GPFS volume mounted via NFS on a OSX file server, then mounted via AFP on a workstation, would not follow name changes (via separate machine). I tracked that down to caches within the Carbon side of the Mac workstation's OS, outside InDesign. Of course Carbon is dead with CC and I have not retried, but just wanted to mention that case.
If Linux is involved (for the server?), it can also play games with names that in OSX would be expected to be canonized(?) or precomposed, regardless of Carbon or not.
On the Mac I found out some of the problems via kernal trace (dtrace, Instruments) and command line utilities such as lsof. Without own experience I think for Windows a good first tool would be Sysinternals / Process Explorer.
Thanks for you detail feedback and the tools you propose. I will test them and let you know.
Happy new Year 2015 to you and all other fellows here
I finally got time to investigate my issue with the tool you suggested. I unfortunately couldn't clear infos with it but it was worth the try anyway.
Also, I did some further attempts this morning and noticed something I didn't so far. Eventually it would deal with some "cache" for InDesign. Let me explain :
If I :
1) open InDesign
2) run my script
3) target a folder
4) ask for a renaming process
Then it's ok all the time. I can do multiple rename.
However if I open/close any of the file within that folder, the folder is no longer rename-able as long as I don't close InDesign. On next startup, If I do the previous steps, it's working fine. I double checked that InDesign had no open documents or books. The fact that restarting InDesign seems to solve the issue makes me think to some "cache" that even once the document was closed, some connection remains on a sub-level. I agree it's highly theoritical but it' the only way I can explain what I see.
I thought I would try to empty the temp folder in case it would magically solve my issue but of course not. Some log files aren't removable anyway.
Also, if some files or subfolders i highlighted on the explorer, the rename fails. But I am not really surprised and it's something that clearly is beyond the scope of scripting here.
Well nothing new. I just wanted to share my last observations.