Published documents do not contain script, only data (tables, fields and variables) and layout (charts, sheets, objects). That's the expected behavior for Publisher and is not an option to modify, for the time being. If you want to make changes to the script, you should to to the Source Documents folder instead of the User Documents folder. Source Documents are those development that are reloaded, distributed, reduced, etc.
User Documents are those who are on the frontend (AccessPoint) so the users can get to them, open them, collaborate and so.
So you need to check for the source document in order to modify the script.
Hope that helps.
Thanks. This helps explain it, but it also raises some serious questions regarding our own set-up here. Looks like there's a crossover in our Source and User Documents (i.e. they're both the same) and this is what has caused my headache this morning.
We have a development server, where nothing gets published as such, but it looks like, in copying back a production document, we've overwritten the development copy.
Unfortunately in my experience, that's not so unsual: making Publisher act as if Publisher wasn't there. Without Publisher, there's only one folder, set up in the QEMC v10 / QMC v11 in the System, Setup, QlikView Servers, Folders tab. The Source Documents folder, however, is set in the System, Setup, Distribution Services, General tab.
One of the Publisher basis assumes is that there is a backend that for security reasons is not available for users but it is for developers or IT people, where the documents are with their correspoding scripts. Then, there is a frontend, that by means of AccessPoint allows users to see their published, reloaded, distributed, reduced QlikView documents.
But of course, both folders may be the same as your case, so certainly the reload and publishing overwrites the original file.
Hope that has shed some light and help on setting up your environment.