Applescript to reboot router by clicking on buttons I am attempting to write an applescript to reboot a router using Safari during the night when no one is using the network.  I can successfully log into the router but am having trouble in selecting the button.  It appears that the button is in a frame and I don't know how to select the button in the frame.  After logging in, the HTML code appears as:

&lt;frame name="topFrame" marginWidth="0" marginHeight="0" src="./frame/top.htm" noResize scrolling="no" frameSpacing="0" frameBorder="0"&gt;
    &lt;frameset cols="182,55%,*"&gt;
        &lt;frame id="frame1" name="bottomLeftFrame" marginWidth="0" marginHeight="0" src="./MenuRpm.htm" noResize frameBorder="1" scrolling="auto" style="overflow-x:hidden"&gt;
        &lt;frame id="frame2" name="mainFrame" marginWidth="0" marginHeight="0" src="./mainFrame.htm" frameBorder="1"&gt;
        &lt;frame name="helpFrame" marginWidth="0" marginHeight="0" src="./help/StatusHelpRpm.htm" frameBorder="1"&gt;
    &lt;/frameset&gt;
&lt;/frameset&gt;


Inside the code for the "bottomLeftFrame," I want to click on the button below:

&lt;li class="ml1"&gt;&lt;a href="#__time.htm" id="menu_tools" onclick="return menuClick(this);" class="T  plus"&gt;System Tools&lt;/a&gt;&lt;ul class="mu2  nd"&gt;&lt;li class="ml2"&gt;&lt;a href="#__time.htm" id="menu_time" onclick="return menuClick(this);" class="T "&gt;- Time Settings&lt;/a&gt;        &lt;/li&gt;&lt;li class="ml2"&gt;&lt;a href="#__pingNTraceRoute.htm" id="menu_diag" onclick="return menuClick(this);" class="T"&gt;- Diagnostic&lt;/a&gt;&lt;/li&gt;&lt;li class="ml2"&gt;&lt;a href="#__defaultCfg.htm" id="menu_def" onclick="return menuClick(this);" class="T"&gt;- Factory Defaults&lt;/a&gt;&lt;/li&gt;&lt;li class="ml2"&gt;&lt;a href="#__restart.htm" id="menu_restart" onclick="return menuClick(this);" class="T"&gt;- Reboot&lt;/a&gt;&lt;/li&gt;&lt;li class="ml2"&gt;&lt;a href="#__password.htm" id="menu_mcl" onclick="return menuClick(this);" class="T"&gt;- Password&lt;/a&gt;&lt;/li&gt;&lt;li class="ml2"&gt;&lt;a href="#__log.htm" id="menu_log" onclick="return menuClick(this);" class="T"&gt;- System Log&lt;/a&gt;&lt;/li&gt;&lt;li class="ml2"&gt;&lt;a href="#__stat.htm" id="menu_stat" onclick="return menuClick(this);" class="T"&gt;- Statistics&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;


Can someone please show me how I can select the menu item with the id of "menu_tools"? Thanks!
There's no way for me to know if this following code will help you, without being able to see the website and test the script.  The action for clicking a button in Safari (by identifying the button by its ID), requires the use of JavaScript within your AppleScript code…

As long as this button is not within a drop-down menu or pop-up window or something else, this script should work for you

tell application "Safari"
    do JavaScript "document.getElementById('menu_tools').click();" in document 1
end tell