Oh, wait, I misread it, GMNote is a script? I thought you just meant the gm notes in a token. Is it this script? on('ready',function(){
'use strict';
on('chat:message',function(msg){
if('api' === msg.type && msg.content.match(/^!wgmnote/) && playerIsGM(msg.playerid) ){
let match=msg.content.match(/^!wgmnote-(.*)$/),
regex;
if(match && match[1]){
regex = new RegExp(`^${match[1]}`,'i');
}
_.chain(msg.selected)
.map( s => getObj('graphic',s._id))
.reject(_.isUndefined)
.reject((o)=>o.get('gmnotes').length===0)
.each( o => {
if(regex){
let lines=_.filter(decodeURIComponent(o.get('gmnotes')).split(/(?:[\n\r]+|<br\/?>)/),(l)=>regex.test(l)).join('\r'); sendChat(o.get('name'),'/w gm '+ decodeURIComponent(o.get('wgmnotes')));
} else {
sendChat(o.get('name'),'/w gm '+ decodeURIComponent(o.get('gmnotes')));
}
});
}
});
});