Jeff,
Thanks for the input. My problem would be a lot easier if I got just version 1.0 this way.
I'm doing this in Alfresco Web Explorer.
The problem I'm solving is to rename the document according to the version number set in Alfresco so that for example file.odt coming in becomes file_A00.odt. If the user creates a new major version it's changed to file_B00.odt (a new minor version would be file_A01.odt) and so forth. In the end I fiddled a lot with the versionable rule and my script. I now have the rule off and I do all the versioning in my script code. This script ends up setting the autoVersion property to true so that an initial document update works as expected. My script runs for incoming files and updated files.
It seems to work reliably except for a problem I noticed and haven't solved yet. Right after the document goes in and gets renamed if I check it out and the check it in again from the same space, a new version is created but the rule is not fired so the document is not renamed. If I check it in from another file the script runs. If I do this after I update the file it also runs fine. In other words, there seems to be something that gets cleared after creation of the first version after 1.0. Maybe yy script needs to set something else. It adds the versionable aspect with initial version and auto version false and at the end sets auto version on. Do you have a suggestion? Is this a versioning bug?
Thanks.