
Edit: Solved. Extra parentheses in repstring. Hello. I'm trying to write a parser for importing NPCs from a pdf of Rappan Athuk, since it has so many monsters. Anyways, I'm stuck adding actions. I figured it might be some weird problem, so I made a simpler version to add an action seen below. The result is, for an NPC using the 5E OGL sheet, it adds 2 actions, one being the one specified by the script, which is not functional (clicking on it does nothing), the other being a blank action before it, which is clickable. This replicates the problem I have in the larger script. I copied the generateUUID and generateRowID code from another thread, which seemed to work on other sheets I've tried it on (adding weapons and such). //ActionMaker Test var generateUUID = ( function () { "use strict" ; var a = 0 , b = []; return function () { var c = ( new Date ()). getTime () + 0 , d = c === a ; a = c ; for ( var e = new Array ( 8 ), f = 7 ; 0 <= f ; f --) { e [ f ] = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" . charAt ( c % 64 ); c = Math . floor ( c / 64 ); } c = e . join ( "" ); if ( d ) { for ( f = 11 ; 0 <= f && 63 === b [ f ]; f --) { b [ f ] = 0 ; } b [ f ]++; } else { for ( f = 0 ; 12 > f ; f ++) { b [ f ] = Math . floor ( 64 * Math . random ()); } } for ( f = 0 ; 12 > f ; f ++){ c += "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" . charAt ( b [ f ]); } return c ; }; }()), generateRowID = function () { "use strict" ; return generateUUID (). replace ( /_/ g , "Z" ); }; on ( "ready" , function () { on ( "chat:message" , function ( msg ) { if ( msg . type === "api" && msg . content === "!ActionMakeTest" ) { ActionTest ( msg ); } }); }); function ActionTest ( msg ) { let reps = getObj ( msg . selected [ 0 ]. _type , msg . selected [ 0 ]. _id ). get ( 'represents' ); let actionObj = { name: "blah" , description: "bobloblaw" } const repString = `repeating_npcaction_ ${ generateRowID () } )` ; const data = {}; Object . keys ( actionObj ). forEach ( field => { data [ ` ${ repString } _ ${ field } ` ] = actionObj [ field ]; }); setAttrs ( reps , data ); } Result (2 actions, first is blank and works, second is desired action name and body, does not click):