Forum: Poser Python Scripting


Subject: Replace a multiline XML string between two delimiters

HartyBart opened this issue on Sep 08, 2021 ยท 7 posts


HartyBart posted Thu, 09 September 2021 at 2:59 PM

Many thanks, especially for the advice on closing files properly if using this method. I'm assuming the advanced user has of course made a safe backup of the target file. I did think of going further and having the script:

  1. extract a remote copy of the target file,
  2. duplicate and timestamp it so there's a safe backup,
  3. then do the replace,
  4. then paste the changed file back to overwrite the original.

But since changing the XML does not affect Poser's UI when running (I assume it's loaded at start and then resides in memory), there seemed no point going further. But obviously if someone had need for this sort of search-and-replace between X and Y, then they might put those sort of safety measure in place.



Learn the Secrets of Poser 11 and Line-art Filters.