H Keith,
Thanks again. Having trouble with this as it crashes the sandbox each time I use it and it displays the message below.
I select a token, run the macro as a token action and target the monster token then the crash occurs.
I also have the token mod Players can ID set to On
Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Mod Library, you might find help in the Community API Forum.
For reference, the error message generated was: TypeError: Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')
at apiscript.js:12911:40
at file:///home/node/d20-api-server/src/pubsub2.js:42:46
at Map.forEach (<anonymous>)
at PubSub.publish (file:///home/node/d20-api-server/src/pubsub2.js:42:35)
at Timeout.processChatQueue [as _onTimeout] (file:///home/node/d20-api-server/api.js:1350:14)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)