{"id":115,"date":"2009-01-21T18:41:06","date_gmt":"2009-01-22T01:41:06","guid":{"rendered":"http:\/\/www.kernelcrash.com\/blog\/?p=115"},"modified":"2009-01-21T20:42:29","modified_gmt":"2009-01-22T03:42:29","slug":"shut-up-alex","status":"publish","type":"post","link":"https:\/\/www.kernelcrash.com\/blog\/shut-up-alex\/2009\/01\/21\/","title":{"rendered":"Shut up Alex"},"content":{"rendered":"<p>Since getting the macbook I&#8217;ve been using iChat as my jabber client. It works fine. I&#8217;ve also turned on text-to-speech using the Alex voice for when new messages come in to a chatroom. I find I can then &#8216;listen in&#8217; on chatroom discussions without having to have the chat window visible anywere. And the &#8216;Alex&#8217; voice is such a major improvement over most computerised voices &#8230; that it doesn&#8217;t end up irritating me (however, it would be nice if Leopard came with a female equiv. of Alex, or some non-American accents).<\/p>\n<p>Anyway, having &#8216;Alex&#8217; chattering away is fine most of the time, but whenever someone posts a URL into a chatroom it becomes very irritating when Alex decides to spell out the whole thing. For example;<\/p>\n<blockquote><p>aytch tee tee pee colon slash slash double-u double-u double-u dot kay eee arr en eee ell see arr ay es aytch dot see oohh emm &#8230;..<\/p><\/blockquote>\n<p>Of course you can mute your overall sound quite quickly &#8230; but ultimately you just want to temporarily mute the speech volume only. Of course, inside the preferences for iChat, under Alerts is the &#8216;Speech Volume&#8217; slider. Just slide that to zero and the speech goes away. Of course, that takes a bit of point and clicking &#8230; and usually I can&#8217;t be bothered.<\/p>\n<p>So I thought Applescript might be the solution. I&#8217;d never looked at Applescript before, so there was a bit to learn.<\/p>\n<p>Ultimately I came up with this script;<\/p>\n<blockquote>\n<pre>set front_app to (path to frontmost application as Unicode text)\r\ntell application \"iChat\"\r\n   activate\r\nend tell\r\ntell application \"System Events\"\r\n   tell process \"iChat\"\r\n      keystroke \",\" using {command down}\r\n      click button \"Alerts\" of tool bar 1 of window 1\r\n      tell slider 1 of group 1 of group 1 of group 1 of window 1 to set value to 0\r\n      keystroke \"w\" using {command down}\r\n\r\n   end tell\r\nend tell\r\ntell application front_app\r\n\tactivate\r\nend tell<\/pre>\n<\/blockquote>\n<p>This works with Leopard at the moment. The key line is the &#8216;tell slider&#8230;&#8217; line that sets the value to zero. If you want to change the volume back to something more normal, you just use a decimal number less than 1.0. For example;<\/p>\n<blockquote><p>tell slider 1 of group 1 of group 1 of group 1 of window 1 to set value to 0.6<\/p><\/blockquote>\n<p>which sets the speech volume to 60%<\/p>\n<p>So I&#8217;ve just saved two scripts to ~\/Library\/Scripts;<\/p>\n<blockquote><p>SpeechVolume60.scpt<br \/>\nSpeechVolume0.scpt\n<\/p><\/blockquote>\n<p>One sets the volume to 60%, the other to 0%. Then I just have some hotkeys set up in <a href=http:\/\/www.red-sweater.com\/fastscripts\/index.html>Fastscripts<\/a> to call them. So as soon as I hear Alex starting to pronounced his http&#8217;s, I just hit the hotkey to shut him up. Then set the volume back to 60%.<\/p>\n<p>Note: For reference I found the <a href=http:\/\/developer.apple.com\/samplecode\/UIElementInspector\/index.html>UIElementInspector<\/a> particularly useful in working all this out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since getting the macbook I&#8217;ve been using iChat as my jabber client. It works fine. I&#8217;ve also turned on text-to-speech using the Alex voice for when new messages come in to a chatroom. I find I can then &#8216;listen in&#8217; on chatroom discussions without having to have the chat window visible anywere. And the &#8216;Alex&#8217; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-115","post","type-post","status-publish","format-standard","hentry","category-mac"],"_links":{"self":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/comments?post=115"}],"version-history":[{"count":14,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions\/129"}],"wp:attachment":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}