Member
Join Date: Jan 2013
Posts: 61
|
One of the methods of data entry that is suggested for Realm Works is to put in the "Skeleton" of the data so that linking is enabled from the get-go. This could be a lot of clicking for a deep topic, such as spells from the 5e SRD, cities from a world, monsters, weapons, etc.... I still don't think there's a method for add multiple topics at once in the program, so I hacked this together, which basically takes a list of things from one place and makes them a list of topics in Realm Works.
First, the main workhorse for this is AutoHotKeys, which is a robust scripting program that I'm using to handle Windows. (if you're not familiar with it, I suggest reading through the extensive help file) Second, you need a text editor that has macro ability, I use Notepad++. (again, if you're unfamiliar with the macro functionality, it pays to look it over) And, of course, Realm Works. Part 1 - Data prep and macro creation We need a list of spells, I found an excel sheet with the spell names and pasted those into Notepad++, the important thing is that each topic you wish to create should be on one line in the file. Next, I created a macro in Notepad++ that does; 'bring me to the top - Ctrl+Home 'select my first line - Shift+End 'cut me to the clipboard - Shift+Delete 'remove my empty line - Delete I save this marco and give it a keystroke combination. Part 2 - AutoHotKeys We need to be able to go to Notepad++, run our macro on our spell list and then go into Realm Works, create a new Topic, paste the spell from the clipboard First, create a script as explained in AutoHotKeys documentation Next, Paste this in (the number next to Loop is the number of items in your list) Code:
Loop, 10 { WinActivate, ahk_exe notepad++.exe ; Activate Notepad++ instance WinWaitActive, ahk_exe notepad++.exe ; Wait until Notepad++ is active Send !^+C ; Send Keystroke for Macro Sleep, 1000 ; Sleep for a second WinActivate, ahk_exe RealmWorks.exe ; Activate RealmWorks WinWaitActive, ahk_exe RealmWorks.exe ; Wait until RealmWorks is active Send ^q^v{Enter} ; Keystrokes to Create Topic, Paste Clipboard, Save Topic Sleep, 1000 ; Sleep for a second } The script assumes both Notepad++ and Realm Works are open. In Notepad++, your list should be on the tab with focus. In Realm Works, you should manually go in and create a new topic under the category you're adding to so that future visits for the script are pointing at the correct category. Set the number in the Loop to the number of items in your list (I would test a few, prior to running a large list). Right-Click the script and "Run Script". Wait a few minutes. Hope this can be of some use to folks. I can try to answer questions about it, but stuff like this I typically throw together quickly by trial and error. |
#1 |
Senior Member
Join Date: Jan 2012
Posts: 1,147
|
Oh, to be able to parse a spreadsheet or comma delimited file to fill in multiple sections quickly.... Maybe someday.
In the meantime, this is a great step in the right direction. Thank you for the step-by-step. Very useful! • Report RealmWorks bugs here • Report Pathfinder HeroLab bugs here • Report 5e HeroLab bugs here • Report 5e HeroLab Community Pack bugs here |
#2 |
Member
Join Date: Jan 2013
Posts: 61
|
It looks highly possible to be able to set up scripts that would enter all the data into a topic, but you'd have to know exact keystrokes and have the data formatted, it'd be very tedious to setup.
|
#3 |
Senior Member
Join Date: Dec 2014
Location: Twin Cities Area, MN, USA
Posts: 1,325
|
Nice! I use PhraseExpress to automate a number of things in RW and to create keyboard shortcuts where none exist. I have done anything like this yet. Might be nice for Monster lists. Thanks for the walkthrough!
RW Project: Dungeons & Dragons 5th edition homebrew world Other Tools: CampaignCartographer, Cityographer, Dungeonographer, Evernote |
#4 |
Member
Join Date: Jan 2013
Posts: 61
|
Yeah, I used it for entering spells and monsters from text lists from the 5e SRD, so about 800 items, took about 20 minutes. Part of that time is that I have sleep steps between application changes and that gives it time to catch up, without those, the script was copy/pasting quicker than the switch, I choose a second, but didn't test anything quicker and it might work with a smaller interval.
For in application stuff, I have a Logitech G15 that I program keystrokes into for highly repetitive tasks or to setup hotkeys. |
#5 |
Senior Member
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 781
|
Quote:
That's awesome! Exmortis aka "Scott" RW - Needs Rez spell HL - Game Master/Designer RPG Tools - Campaign Cartographer 3+, D20 Pro Ultimate Real Life - IT Security Hobby - Anything on water or ATV |
|
#6 |
Senior Member
Join Date: May 2013
Location: Birmingham, UK
Posts: 459
|
Would you be able to create a bunch of Tags do you think?
Sleet was enjoying a tasty beverage at his local tavern, when a Tarrasque showed up in the local area. He managed to valiantly get on it's back and ride it. How he did it is a mystery to this day... RW: Engine Heart, I Love The Corps! Home Brew: Star Gate: Avalon, Monda Minutia. I'm good with: OpenOffice, Paint, Lego Digital Designer. & not so good with: Realm Works, Hero Lab, CC3+, GIMP, Cityographer, Hexographer, Fractal Mapper, AstroSynth, Inspiration Pad Pro. RW Kickstarter Supporter. |
#7 |
Member
Join Date: Jan 2013
Posts: 61
|
Yeah, it'd be similar, once the tag is open go back into the list, copying the next item, return to Realm Works, paste, determine the keystrokes to hit the "add" button. With a little messing around might even be able to script multiple tag lists. Sounds useful to me already, I'll poke around today or tomorrow and see what's quickly possible.
|
#8 |
Member
Join Date: Jan 2013
Posts: 61
|
Or, AutoHotKeys seems to be very well designed. I was able to setup a simple text file with a list of items. I then went into Realm Works made a new Tag group, Clicked the "add tag" button and run the following script, it will bring focus back to Realm Works and process through the list.
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. WinActivate, ahk_exe RealmWorks.exe ; Activate RealmWorks WinWaitActive, ahk_exe RealmWorks.exe ; Wait until RealmWorks is active Loop, Read, Sample.txt ; Sample.txt needs to be in the directory that the script runs from. { clipboard = %A_LoopReadLine% ; load the current line into the window's clipboard Send ^v {Return} ; paste the contents of the clipboard into the testbox and press Enter } Which means that a similar script could be created for the topics, there is also some built in parsing in AutoHotKeys that would allow delimited files to be used to enter snippets into the topics, but you'd have to have that planned out well. Last edited by Kathorus; October 10th, 2016 at 06:29 PM. Reason: additional thoughts |
#9 |
Member
Join Date: Jan 2013
Posts: 61
|
|
#10 |
|
|