I am attempting to store Javascript objects in abilities on the character sheet, but when I try to extract the object from the string, I get the error in the title. Here is the relevant code: let SkillsA = findObjs({ characterid: attacker.id, type: "ability"});
for (var i in SkillsA){
SkillsA[i] = SkillsA[i].get("action"); //grabs the "macro text" of each ability
}
SkillsA = eval(SkillsA[0]); //gets the firstmost string in the list and parses it as code; this is where the error is thrown
log(SkillsA); And here is the ability text: {
triggertime: 'during',
u_wepreq: 'none',
e_wepreq: 'none',
whotriggered: 'either',
radius_effect: 'none',
physmagcond: false,
u_healfactor: 0,
e_healfactor: 0,
u_hitmod: 0,
e_hitmod: 0,
u_critmod: 0,
e_critmod: 0,
u_avomod: 0,
e_avomod: 0,
u_ddgmod: 0,
e_ddgmod: 0,
physmag: true,
damagemod: 0.5 * Physmag,
u_stat_target: 'none',
e_stat_target: 'none',
u_stat_targetmod: 0,
e_stat_targetmod: 0,
children_skills: []
}; Note that I have been able to extract JSON objects from the abilities section before, though I am not using that method due to the fact that I have to reference the Physmag variable (with a value of 1), and as I understand it, such an expression would not be valid JSON.