I posted a previous question that received no replies, so this is an attempt to ask a better question. I’m a new Mac user and I’m trying to write an applescript that will start XM radio online automatically and choose a station so I could wake up to it. Thus far I can open Safari and navigate to the correct URL. My script looks like this so far (the delays are in there temporarily, I’m just trying to get the main part of the script to work):
tell application “Safari”
activate
open location “http://xmro.xmradio.com/xstream/index.jsp”
delay 10
do JavaScript “/xstream/login_servlet.jsp?tabindex=1&tabindex=2” in window 1
delay 4
do JavaScript “http://xmro.xmradio.com/xstream/_js/validate.js” in window 1
delay 4
do JavaScript “http://xmro.xmradio.com/xstream/index.jsp” in window 1
end tell
The problem I’m having is I don’t know much about JavaScript, so I don’t know what syntax to use for the jsp calls. I’ve tried many variations in the do JavaScript "/xstream/login_servlet.jsp statement. (My id and password are automatically filled in when I navigate to the page).
If someone could help, I’d be very grateful.
Here’s what the source for the URL looks like:
XM Radio - XM RADIO ONLINE #leftbg { background-color:#FFCC66; background-image:url("/images/home_bg.gif"); background-repeat:no-repeat; } #not_yet_bg { background-color:#FFCC66; background-image:url("/images/not_yet_bg.gif"); background-repeat:no-repeat; }a.tDkRed {color:#990000; text-decoration:underline; font-weight:bold;font-size:11px;}
a.tDkRed:hover {color:#990000; text-decoration:underline; font-weight:bold;font-size:11px;}
<td><a href="http://www.xmradio.com/xstream/" onMouseOver="img_act('b_listennow')" onMouseOut="img_inact('b_listennow')"><img name="b_listennow" src="http://img.xmradio.com/images/b_listennow.gif" width="104" height="60" border="0" alt="Listen Now"></a></td>
</tr>
<tr valign="top" class="bBlack"><!-- row 2 -->
<td><a href="http://www.xmradio.com/learn/index.jsp" onMouseOver="img_act('b_howitworks')" onMouseOut="img_inact('b_howitworks')"><img name="b_howitworks" src="http://img.xmradio.com/images/b_howitworks.gif" width="148" height="30" border="0" alt="Learn About XM"></a></td>
<td><img src="http://img.xmradio.com/images/spacer.gif" width="1" height="30" border="0"></td>
<td><a href="http://www.xmradio.com/get_xm" onMouseOver="img_act('b_getxmradio')" onMouseOut="img_inact('b_getxmradio')"><img name="b_getxmradio" src="http://img.xmradio.com/images/b_getxmradio.gif" width="148" height="30" border="0" alt="Get XM Radio"></a></td>
<td><img src="http://img.xmradio.com/images/spacer.gif" width="1" height="30" border="0"></td>
<td><a href="http://www.xmradio.com/programming/programming_main.jsp" onMouseOver="img_act('b_programming')" onMouseOut="img_inact('b_programming')"><img name="b_programming" src="http://img.xmradio.com/images/b_programming.gif" width="148" height="30" border="0" alt="Programming"></a></td>
<td valign="bottom" align="right">
<img src="/images/spacer.gif" width="104" height="1" border="0">
</td>
</tr>
|