Okay, I have a code snippet which should work for spell import (and probably for weapons and equipment as well, but lets crawl before sprinting). You can put this among your sheetworkers: const powerimport = (section) => {
getAttrs([`${section}import`], v => {
newrowattrs = {};
multiweap = v[`${section}import`];
multiweaparray = multiweap.split("}");
multiweaparray.forEach ( (weap) => {
let newrowid = generateRowID();
weaparray=weap.split("|");
weapobj = {};
weaparray.forEach( (item) => {
var pair=item.split("^");
weapobj[pair[0]]=pair[1];
newrowattrs[`repeating_${section}_` + newrowid + `_${pair[0]}`] = weapobj[pair[0]];
});
});
setAttrs(newrowattrs);
});
}; It demands there be a text attribute called [repeatingfieldname]import (in your sheet's case, "spellsimport") into which the user can paste something like this: spell_name^Cure Light Wounds|spell_level^1|spell_school^Necromantic|spell_range^Touch|spell_duration^Permanent|spell_aoe^Character touched|spell_components^V,S|spell_ct^5 segments|spell_save^None|spell_description^Upon laying his or her hand upon a creature, the cleric causes from 1 to 8 hit points of wound or other injury damage to the creature's body to be healed. This healing will not affect creatures without corporeal bodies, nor will it cure wounds of creatures not living or those which can be harmed only by iron, silver, and/or magical weapons. Note that cured wounds are permanent only insofar as the creature does not sustain further damage.spell::spell_name^Cure Light Wounds|spell_level^1|spell_school^Necromantic|spell_range^Touch|spell_duration^Permanent|spell_aoe^Character touched|spell_components^V,S|spell_ct^5 segments|spell_save^None|spell_description^Upon laying his or her hand upon a creature, the cleric causes from 1 to 8 hit points of wound or other injury damage to the creature's body to be healed. This healing will not affect creatures without corporeal bodies, nor will it cure wounds of creatures not living or those which can be harmed only by iron, silver, and/or magical weapons. Note that cured wounds are permanent only insofar as the creature does not sustain further damage. You call it in sheetworkers as powerimport("spells") as the response to a button press, such as: const configbuttonlist8 = ["spellimporter"];
configbuttonlist8.forEach(button => {
on(`clicked:${button}`, function() {
powerimport("spells");
});
}); Maybe put the import field and button in right before Spells Notes: </ div > </ div > </ div > </ fieldset > </ div > <div class="sheet-table-row">
<textarea spellcheck="false" placeholder="Paste spell details here" name="attr_spellsimport" value="" title="@{spellsimport}"></textarea>
<button type="action" name="act_spellimporter" >Import Spells</button>
</div> < div class =" sheet-table-row " style =" margin-top: 1em; " > < b style =" margin-left:20px; " > Spells Notes </ b > < input type =" checkbox " class =" sheet-sect-show " title =" @{spellsnotes-show} " name =" attr_spellsnotes-show " value =" 1 " style =" width: 140px; margin: 0 -20px 0 -115px; " /> < span > </ span > < div class =" sheet-table sheet-sect " > < div class =" sheet-table-row sheet-center sheet-sect " > < textarea name =" attr_spellsnotes " title =" @{spellsnotes} " placeholder =" Spells Notes " > </ textarea > </ div > </ div > </ div > The powerimport code shouldn't have to be modified to use it for weapons or equipment, you just have to change the calls to powerimport("weapon") and powerimport("equipment") and the input attributes to "weaponimport" and "equipmentimport". A cleverer coder than I could likely come up with a way to have a single field which imported anything and everything, but that coder is not me. If you use the } character as a delimiter, this actually should import multiple spells at once, so you could technically assemble your spell list in some random Google Sheet somewhere and paste the whole thing into your character sheet at once: spell_name^Cure Light Wounds|spell_level^1|spell_school^Necromantic|spell_range^Touch|spell_duration^Permanent|spell_aoe^Character touched|spell_components^V,S|spell_ct^5 segments|spell_save^None|spell_description^Upon laying his or her hand upon a creature, the cleric causes from 1 to 8 hit points of wound or other injury damage to the creature's body to be healed. This healing will not affect creatures without corporeal bodies, nor will it cure wounds of creatures not living or those which can be harmed only by iron, silver, and/or magical weapons. Note that cured wounds are permanent only insofar as the creature does not sustain further damage.}spell_name^Cause Light Wounds|spell_level^1|spell_school^Necromantic|spell_range^Touch|spell_duration^Permanent|spell_aoe^Character touched|spell_components^V,S|spell_ct^5 segments|spell_save^None|spell_description^Upon laying his or her hand upon a creature, the cleric causes from 1 to 8 hit points of damage, and if a person is avoiding this touch, a melee combat "to hit" die is rolled to determine if the cleric's hand strikes the opponent and causes such a wound. Note that caused wounds will heal -- or can be cured-- just as any normal injury will. I haven't tested the limitations of this... is there some finite number of characters beyond which this breaks? Unknown. But this should work for a simple importer, and if you end up preferring other delimiters besides "}", "|", and "^", I can change my Google sheet in seconds to match. "}" is probably not the best as a delimiter, as True Coders would find a way to write it such that you could import the macro-text fields as well... and that seems a bit daunting. Ya gotta draw the line somewhere, and that's where it is for me. You're welcome to any of this code, or none of it. I'm making my not-compendium to match this format for now, and will change it in the future if you select something else. Thanks again for taking this on!