See if this does what you're looking for. It only takes one selected target and one target click, run it with the macro: !faceme --s @{selected|token_id} --t @{target|token_id} /* globals getObj, on */ on('ready', () => { on('chat:message', (msg) => { if (msg.type === 'api' && /^!faceme/i.test(msg.content)) { const selectedId = (msg.content.match(/--s(elected)?\s*(-[A-Za-z0-9_-]{19})/)||[])[2], targetId = (msg.content.match(/--t(arget)?\s*(-[A-Za-z0-9_-]{19})/)||[])[2], selectedToken = selectedId ? getObj('graphic', selectedId) : null, targetToken = targetId ? getObj('graphic', targetId) : null; if (!targetToken || !selectedToken) return; const targetPos = { x: parseInt(targetToken.get('left'))||0, y: parseInt(targetToken.get('top'))||0 }; if (selectedToken.get('_subtype') === 'token') { const selectedPos = { x: parseInt(selectedToken.get('left'))||0, y: parseInt(selectedToken.get('top'))||0, }; const delta = { x: targetPos.x - selectedPos.x, y: selectedPos.y - targetPos.y, }; const angleFromY = Math.atan(delta.x/delta.y), degreesFromY = angleFromY*(180/Math.PI), degreesFromZero = delta.y > 0 ? angleFromY >= 0 ? degreesFromY : 360 + degreesFromY : delta.y < 0 ? 180 + degreesFromY : 180 - degreesFromY; // console.info(`Rads from Y: ${angleFromY}, degrees from Y: ${degreesFromY}, degrees from 0: ${degreesFromZero}`); selectedToken.set('rotation', degreesFromZero); } } }); });