<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 8:31 AM, Randy Brown <span dir="ltr"><<a href="mailto:randy@brownragfilms.com" target="_blank">randy@brownragfilms.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-size:14px">$num = rand ( 1, 1000 ); </div><div style="font-size:14px">SDVA($GUIButtons, array(</div><div style="font-size:14px">  'mybutton'       => array(8000, "{(mymarkupexpression ".$num." &quot;", "&quot;)}\\nThe above number is ".$num."<a>\\n</a>", '$[Default text if none selected]',</div><div style="font-size:14px">                  '$GUIButtonDirUrlFmt/mybuttonicon.png"$[DoXYZ]"','')</div><div style="font-size:14px">));</div><div style="font-size:14px">$HTMLHeaderFmt['DoXYZ']= <<<EOF</div><div style="font-size:14px"><script type='text/javascript'><!--</div><div style="font-size:14px">function DoXYZ() {</div><div style="font-size:14px"><br></div><div style="font-size:14px">I IMAGINE THERE IS A WAY TO DO THIS IN JAVASCRIPT</div><div style="font-size:14px"><br></div><div style="font-size:14px">  return;</div><div style="font-size:14px">}</div><div style="font-size:14px">//--></script></div><div style="font-size:14px">  </div><div style="font-size:14px">EOF;</div></blockquote></div><br>I don't think there's an easily configurable way to do this (i.e., nothing as simple as adding something to $GUIButtons - insButton() doesn't support executable javascript code due to quoting).  However, in the spirit of fairly messy code that seems to work, try this in config.php:</div><div class="gmail_extra"><br></div><div class="gmail_extra">===(snip)===</div><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">Markup('e_guibuttons', 'directives',</div><div class="gmail_extra">  '/\\(:e_guibuttons:\\)/e',</div><div class="gmail_extra">  "Keep(FmtPageName(GUIButtonCode(\$pagename), \$pagename).'<script type=\'text/javascript\'><!--\nInsertSpecialBtn();//--></script>')");</div><div class="gmail_extra">SDVA($HTMLHeaderFmt, array('guiedit2' => "<script type='text/javascript'></div><div class="gmail_extra">    function DoSpecialBtn() </div><div class="gmail_extra">    { </div><div class="gmail_extra">        var num = Math.floor(Math.random()*10)+1;</div><div class="gmail_extra">        insMarkup('{(mymarkupexpression '+num+ ' \"', '\")}\\nThe above number is '+num, 'My text'); </div><div class="gmail_extra">    } </div><div class="gmail_extra">    function InsertSpecialBtn() </div><div class="gmail_extra">    { </div><div class="gmail_extra">        document.write('<a tabindex=\"-1\" r onclick=\"DoSpecialBtn()\">asdf</a>'); </div><div class="gmail_extra">    } </div><div class="gmail_extra"></script>\n"));</div></div><div class="gmail_extra">===(snip)===<br></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">It basically overrides the e_guibuttons markup so it will add your special button immediately after the rest of the GUI buttons.  Then it defines a short javascript with a function to insert the button and another function to calculate the random number and construct your text.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Note that I've hardcoded the random number to be between 1 and 10, hardcoded the access key to r, hardcoded the button to the imaginative text of "asdf", etc - it's messy but should get you 90% of the way there.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-Peter</div></div>