<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 12, 2017 at 7:52 AM, <a href="mailto:opto@optosolar.com">opto@optosolar.com</a> <span dir="ltr"><<a href="mailto:opto@optosolar.com" target="_blank">opto@optosolar.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">many thanks for that answer.<br>
<br>
How do I find all tagged messages? Would notability help?<br>
<br>
I get all tags by: var tagArray = MailServices.tags.getAllTags({<wbr>});<br>
<br>
This works: query.tags(tagArray[1],<wbr>tagArray[2]);<br>
<br>
But I don't know how many tags there might be. So I tried to replace parameter list by apply: query_q.tags.apply(this,<wbr>tagArray);<br></blockquote></div><br></div><div class="gmail_extra">You shouldn't be using `this` there, since it's not the object whose method you're calling; the object is `query_q`. Thus, you should use `query_q.tags.apply(query_q, tagArray)`. But it would be simpler if you just used the spread operator, available since Firefox 27: `query_q.tags(...tagArray)`.<br><br></div><div class="gmail_extra">- Jim<br></div></div>