I think a solution like mynetx made is best as a temporary fix, include blank .js files, delete them and also the .js file that deletes them also gets removed (this can be made through a try/catch statement globally so that initialize doesn't look for a non-existant function in the future).
As for deleting files, well I think we need to be able to make lists of some kind. My scripts (like many others) need to keep text files and xml files, however some other xml files or text files should be updated/removed. The same thing goes for folders.
Maybe a better solution would be something like the following...
code:
<ScriptInfo>
<Information>
<Description>lol.</Description>
<Version>1</Version>
<Name>testscript</Name>
</Information>
<Import>
<RemoveFolder>folder1\subfolder</RemoveFolder> <!-- Removes the folder "subfolder" -->
<RemoveFile>folder2\*.png</RemoveFile> <!-- Removes all .PNG files from folder1 -->
<RemoveFile>old_ui.xml</RemoveFile> <!-- Removes the file "old_ui.xml" from the script's root directory -->
<RemoveFolder>folder*\*< RemoveFolder> <!-- Removes all subfolders in "folder1" and "folder2" and any other folder that starts with "folder" -->
</Import>
</ScriptInfo>
If I was asking for a lot then I would want regex compatibility, but * as a wildcard is good enough i guess....