I’m in the intial stages of designing a group of folder actions to rename files that are dropped into the respective folders.
The script will rename files using a sequential serial number (so a duplicate name will never be created). Since this number needs to be persistantly updated each time the folder action fires, I think that a property that gets incremented should do the trick.
My question is would this be a safe way to do this or should I consider creating a “preference” text file to hold this (important) setting. The script would open the text file, increment to serial value as many times as it needs (for as many files have been dropped into the folder), update the value in the preference (text) file, then close and save the file. It seems cumbersome, but perhaps more reliable?
Another question I had about properties involves how a property will be handled if files are going into the folder action folder simultaneously. The folder action folder is going to reside on a file server that many users will have access to, so potentially 2 or more users may add files at (almost) the same time. Will this cause 2 separate instances of the folder action to fire? How will the property get updated in this case? I ask because I want the folder action to return the original names of the files and the new names of the files to a Filemaker database in the user’s frontmost record. I guess I’m concerned with how a folder action will handle this posssibility.
Thanks for any thoughts on this. Please don’t give me a script for this, I’m a newbie and I want to try to figure the script out for myself. I’ll post what I come up with once I get down to writing it.
Thanks again