• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

XML Transformation Script (PowerShell)

I don't know if anyone here remembers, but a while back, I wrote a redaction script for people who wanted to author data sets for Hero Lab. The script would redact descriptions so you could have full descriptions in your own copy but remove them from the shared copy, so as to avoid illegal distribution of copyrighted content.

I figured since I now have a GitHub account and an official signature here, I may as well post the redaction script. I was revisiting that code, and I realized that with what I learned in writing the export script, I can rewrite the redaction script properly.

The way I wrote it originally, it read in the .user files as text files, searched (via plain text) for the Description tag, parsed for the substring of the actual description, and replaced it either with other text, or replaced it with a null value.

Now I can properly read it and handle it as an XML file. :-)
 
Have not, as of yet, had any luck with this, although my Powershell (and coding on the whole) experience is pretty limited... so there's probably a reasonable explanation for it.

On the occasions I've tried it (using the GUI script), the script tends to balk early on (Line 207, right after Mandatory), where I assume that my source file might be incorrect. I've been trying to put everything in the same folder (script, export (compact export) file, css and use the same folder for export of the HTML or DOC) for ease of making sure I've got everything... in my case, C:\Users\Mark\Desktop\Folder. I basically copy and paste direct from Explorer. Should I be trying it as a relative folder instead?

The GUI script locks if I try to click on the buttons to locate, like I would most Windows GUIs, so I've made do by copying and pasting into the entry forms, instead. Attached is a screenshot of my GUI and the powershell reply. First time is running the script standard, second is bypassing entry validation.

Hate to ask, because I'm obviously no coding whiz, but any ideas what I might be doing wrong, just at a look?
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    49.2 KB · Views: 6
  • Clipboard02.jpg
    Clipboard02.jpg
    110.5 KB · Views: 6
Have not, as of yet, had any luck with this, although my Powershell (and coding on the whole) experience is pretty limited... so there's probably a reasonable explanation for it.

On the occasions I've tried it (using the GUI script), the script tends to balk early on (Line 207, right after Mandatory), where I assume that my source file might be incorrect. I've been trying to put everything in the same folder (script, export (compact export) file, css and use the same folder for export of the HTML or DOC) for ease of making sure I've got everything... in my case, C:\Users\Mark\Desktop\Folder. I basically copy and paste direct from Explorer. Should I be trying it as a relative folder instead?

The GUI script locks if I try to click on the buttons to locate, like I would most Windows GUIs, so I've made do by copying and pasting into the entry forms, instead. Attached is a screenshot of my GUI and the powershell reply. First time is running the script standard, second is bypassing entry validation.

Hate to ask, because I'm obviously no coding whiz, but any ideas what I might be doing wrong, just at a look?

First, make sure you have the current version, which is 1.5.

Second, if you're selecting Word as the output format, change your destination file to have a .doc or .docx extension.

Other than that, I'm not sure. Is anyone else besides ArgoForg having these issues?
 
Have not, as of yet, had any luck with this, although my Powershell (and coding on the whole) experience is pretty limited... so there's probably a reasonable explanation for it.

On the occasions I've tried it (using the GUI script), the script tends to balk early on (Line 207, right after Mandatory), where I assume that my source file might be incorrect. I've been trying to put everything in the same folder (script, export (compact export) file, css and use the same folder for export of the HTML or DOC) for ease of making sure I've got everything... in my case, C:\Users\Mark\Desktop\Folder. I basically copy and paste direct from Explorer. Should I be trying it as a relative folder instead?

The GUI script locks if I try to click on the buttons to locate, like I would most Windows GUIs, so I've made do by copying and pasting into the entry forms, instead. Attached is a screenshot of my GUI and the powershell reply. First time is running the script standard, second is bypassing entry validation.

Hate to ask, because I'm obviously no coding whiz, but any ideas what I might be doing wrong, just at a look?

I just downloaded the GitHub version to make sure that I didn't upload bad code, and it's working fine for me. I would be happy to join you on a Skype call or a Google Hangouts call and see what we can figure out together.
 
I just downloaded the GitHub version to make sure that I didn't upload bad code, and it's working fine for me. I would be happy to join you on a Skype call or a Google Hangouts call and see what we can figure out together.

Hi guys,
I just updated my version of the code, and now it doesn't seem to work for me any more, it just hangs and sits there (I left it for about and hour to see if it was something and my realm isn't that big), but after cancelling I could see that it only had about 4 lines in it...

I did the compact export but only selected player content, as this is the information I put into a HTML file for my players.

I have no idea what's different, and to be sure I found one of the older codes that exported to a text file and that seems to work...

Am I missing a step ? I even tried the GUI version with the same result. Any suggestions ?

I'll try and find an older html one to see which version it stopped for me on.
 
I'll try and find an older html one to see which version it stopped for me on.

Unfortunately I tried all the ones on GitHub with the same result.
the only one that works is:
RWExport-To-Text.ps1
# by EightBitz
# Version 0.5a
# 1/17/2017, 3:40 PM CST

I'll try doing a compact export (without turning on the player only flag and see what happens)
 
Unfortunately I tried all the ones on GitHub with the same result.
the only one that works is:
RWExport-To-Text.ps1
# by EightBitz
# Version 0.5a
# 1/17/2017, 3:40 PM CST

I'll try doing a compact export (without turning on the player only flag and see what happens)

Was your previous export a compact export with the player flag turned on, or was it a full export?

Edit: Nevermind, you answered my question already. I'm reading on a tablet in the middle of a frustrating issue with one of my laptops, so my reading comprehension is a bit off right now.

I'll ask you the same question. Can you join me in Google Hangouts or Skype? Not right now, but can we coordinate a time?
 
Last edited:
There's an issue that Happydevil43 helped me discover. This issue happens if:
  • You reveal a smart image snippet.
  • Despite revealing the snippet, you reveal no part of the image.
  • You export only revealed content.

Given this combination of actions, the .rwoutput file will contain no image data for the smart image, and no filename for the smart image.

My script expects both, so the lack of either will cause my script to choke. I will address this issue in the next update, but for now, I just wanted to announce this as a known issue.
 
I'd like to take a poll, just for my own curiosity. This isn't going to affect any functional changes.

For those who use this script, which output method, if either, do you prefer?
a) I prefer HTML.
b) I prefer a Word document.
c) I'll use either or both, depending on circumstances.
 
HTML. I can convert HTML to pretty much anything. HTML also has the advantage, like XML, that the file is human readable. I like that if there is an issue in the output I can at least look at the file and try and figure out what happened.
 
this may be a dumb question but i am not super tech savy so i was wondering if you could give a brief overview of what this program does? i know the orriginal was to convert obsidian portal stuff to realmworks but it seems you have done a lot more work to the program.
 
hay. i am a little lost as to the full capabilities of this script. i know the original was to translate obsidian portal material to realmworks but i know you added a fair few things. would you be willing to post a brief overview of the capabilities
 
Back
Top