
In a workflow's bundle, the /Contents/document.wflow file is a property list that declares the various actions with their settings (such as the script for the Run AppleScript action), action connections, workflow metadata, and any variables. If all you are doing is reading the XML file, I'm not sure what would corrupt it, but an idea similar to the AppleScript comment would be to add a variable to the workflow (both would be in the file). Is there an Apple sanctioned method of versioning an Automator service workflow ? My applet could then interrogate that file to get the version and this know whether the user's copy is out-of-date.
Fourth is to add a plain text file to the contents of the workflow which would contain the version detail. That does work but, opening and reading the workflow file seems like over-kill and runs the risk of that file being over-written or the XML code being corrupted.
Third is to add a comment to the AppleScript code inside the workflow which can be interrogated by my applet. That, however, is over-written by Automator when it saves the workflow. Second is to make a custom property in the workflow's ist file. That works except that users need to be able to retain changes to their copy of the Service which should not be over-written my by applet. If they are different, then, the user's copy is out-of-date and needs to be updated. First is to compare file size of user's copy against the copy being distributed. I need a way to know whether my users' copy of the Service is out-of-date. I update the Service quite often with improvements. The Service has one action: a "Run AppleScript" action. It is used to call code in my AppleScript applet. I have a workflow which is installed as a Service.