<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Web Design &#187; applescript</title> <atom:link href="http://patjack.co.uk/tag/applescript/feed/" rel="self" type="application/rss+xml" /><link>http://patjack.co.uk</link> <description>Patrick Robertson</description> <lastBuildDate>Sun, 29 Apr 2012 09:13:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Toggling Caffeine with Quicksilver to keep your Mac awake</title><link>http://patjack.co.uk/toggling-caffeine-and-keeping-your-mac-awake/</link> <comments>http://patjack.co.uk/toggling-caffeine-and-keeping-your-mac-awake/#comments</comments> <pubDate>Mon, 21 Dec 2009 22:46:41 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Apps]]></category> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[applescript]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[os x]]></category> <category><![CDATA[quicksilver]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=317</guid> <description><![CDATA[Caffeine is a tiny little app that keeps your Mac awake when needed; be it when you&#8217;re watching a video (for some reason, Adobe Flash doesn&#8217;t keep your Mac awake), reading something off your screen, or anything else. It sits in the menu bar waiting to be summoned when needed, and dismissed just as easily. [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft size-full wp-image-320" title="Caffeine" src="http://patjack.co.uk/wp/wp-content/uploads/2009/12/caffeine.png" alt="Caffeine" width="133" height="121" /></p><p><a
href="http://lightheadsw.com/caffeine/">Caffeine</a> is a tiny little app that keeps your Mac awake when needed; be it when you&#8217;re watching a video (for some reason, Adobe Flash doesn&#8217;t keep your Mac awake), reading something off your screen, or anything else.</p><p>It sits in the menu bar waiting to be summoned when needed, and dismissed just as easily.</p><p><img
class="alignright size-full wp-image-322" title="Quicksilver" src="http://qsapp.com/Images/quicksilver_128.png" alt="Quicksilver" /></p><p>Being the lazy type I am (thanks to the inevitable <a
href="http://qsapp.com">Quicksilver</a>), dragging the mouse over  to click the icon is just too much work. Below is an applescript which I run from Quicksilver with 3 key presses (I could set it as a trigger if I really wanted) and it switches it on or off, or even opens it if it&#8217;s not running.<br
/> <span
id="more-317"></span><br
/> <code>tell application "System Events"<br
/> if exists (process "Caffeine") then<br
/> tell application "Caffeine"<br
/> if active is false then<br
/> turn on<br
/> else<br
/> turn off<br
/> end if<br
/> end tell<br
/> else<br
/> tell application "Caffeine" to activate<br
/> end if<br
/> end tell</code></p><p>This will launch the app if it&#8217;s not running. If it is running it&#8217;ll check to see if your Mac is on Caffeine (i.e. if it&#8217;s turned on) and carry out the required action.</p><p>This is all possible thanks to Caffeine being scriptable. It&#8217;s always great when developers add applescript support as well as others to their apps &#8211; it makes the Mac experience that bit more cosy.</p><p>You can download the applescript <a
href="http://patjack.co.uk/files/caffeine.tgz">here</a><br
/> I&#8217;ve even added the right icon to the script <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>All that needs doing is setting up a trigger in <a
href="http://qsapp.com" >Quicksilver</a>, or placing it in<br
/> <code>~/Library/Scripts/</code>.</p><p>Done!</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/toggling-caffeine-and-keeping-your-mac-awake/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Toggle Keyboard Viewer in Snow Leopard 10.6</title><link>http://patjack.co.uk/toggle-keyboard-viewer-in-snow-leopard-10-6/</link> <comments>http://patjack.co.uk/toggle-keyboard-viewer-in-snow-leopard-10-6/#comments</comments> <pubDate>Thu, 10 Dec 2009 10:50:47 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[applescript]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[os x]]></category> <category><![CDATA[quicksilver]]></category> <category><![CDATA[script]]></category> <category><![CDATA[snow leopard]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=296</guid> <description><![CDATA[Ever since upgrading to Snow Leopard, one function I&#8217;ve missed is the ability to toggle the Keyboard Viewer on and off with an applescript. It looks like Apple modified the Keyboard Viewer utility for Mac OS X 10.6 (or a possible tablet, who knows&#8230;) and the old applescripts don&#8217;t work. I&#8217;ve finally come across a [...]]]></description> <content:encoded><![CDATA[<p>Ever since upgrading to Snow Leopard, one function I&#8217;ve missed is the ability to toggle the Keyboard Viewer on and off with an applescript.<br
/> It looks like Apple modified the Keyboard Viewer utility for Mac OS X 10.6 (or a possible tablet, who knows&#8230;) and the old applescripts don&#8217;t work.<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2009/12/keyboard_veiwer-1024x437.jpg" alt="" title="keyboard_veiwer" width="512" height="219" class="aligncenter size-large wp-image-370" /><br
/> I&#8217;ve finally come across a method for getting this to work in Snow Leopard again, although it&#8217;s not as easy as it was in Leopard, and it seems to be as slow as hell to open.<br
/> <span
id="more-296"></span><br
/> Check out Nicholas Riley&#8217;s tiny app (only 6 lines of custom code!) that fixes this:<br
/> <a
href="http://github.com/nriley/keyboardViewer">http://github.com/nriley/keyboardViewer</a> (<a
href="http://cloud.github.com/downloads/nriley/keyboardViewer/keyboardViewer-1.0.zip">download</a>)</p><p>Once that&#8217;s downloaded and installed (you need to go into terminal and move it, or just navigate to /usr/local/bin/ and paste it there), you can then use the applescript listed on the App&#8217;s homepage to get it working in applescript.<br
/> <code><br
/> tell application "System Events"<br
/> if exists (process "Keyboard Viewer") then<br
/> click process "Keyboard Viewer"'s window 1's buttons whose subrole is "AXCloseButton"<br
/> else<br
/> do shell script "/usr/local/bin/keyboardViewer"<br
/> end if<br
/> end tell<br
/> </code></p><p>I have modified this slightly, as the &#8216;click process&#8217; part of the applescript uses a deprecated method (Apple&#8217;s own fault) and could become obsolete at any point. I just used a simple killall command in its place</p><p><code><br
/> tell application "System Events"<br
/> if exists (process "Keyboard Viewer") then<br
/> do shell script "killall KeyboardViewer"<br
/> else<br
/> do shell script "/usr/local/bin/keyboardViewer"<br
/> end if<br
/> end tell<br
/> </code></p><p>And now, my trusty Cmd + Optn + Ctrl + K Quicksilver trigger is back!</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/toggle-keyboard-viewer-in-snow-leopard-10-6/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Toggle screensaver password applescript</title><link>http://patjack.co.uk/toggle-screensaver-password-applescript/</link> <comments>http://patjack.co.uk/toggle-screensaver-password-applescript/#comments</comments> <pubDate>Fri, 28 Nov 2008 17:17:29 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[applescript]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[os x]]></category> <category><![CDATA[quicksilver]]></category> <category><![CDATA[screensaver]]></category> <category><![CDATA[snow leopard]]></category><guid
isPermaLink="false">http://tyddynadda.co.uk/design/?p=77</guid> <description><![CDATA[There&#8217;s a fix for working on Snow Leopard, just read on MacDuff. Thanks to David and Januz for this! Recently, I&#8217;ve been looking for a script to toggle my screen-saver password for my MacBook. While out and about I want to make sure my Mac is safe from stray fingers by making sure a password [...]]]></description> <content:encoded><![CDATA[<h2 style="color:#ff0000">There&#8217;s a fix for working on Snow Leopard, just read on MacDuff. Thanks to David and Januz for this!</h2><p><p>Recently, I&#8217;ve been looking for a script to toggle my screen-saver password for my MacBook.<br
/> While out and about I want to make sure my Mac is safe from stray fingers by making sure a password is required before waking, but when at home or in university there&#8217;s no need for this extra layer of protection.</p><p> Searching the web I found absolutely nothing, except a few scripts that were old and broken.</br><br
/> The only solution; I decided to write my own. You can download the applescript <a
href='http://patjack.co.uk/files/script.zip' title='Toggle Screen-saver Password script'>here</a> in zip form (10.6 &#8211; Snow Leopard compatible version <a
href='http://patjack.co.uk/files/Set_Screensaver_Password_10_6.zip' title='Toggle Screen-saver Password script'>here</a>), or view the script in your browser <a
href="http://patjack.co.uk/files/Toggle-Screensaver-Password.txt">here</a> (10.6 &#8211; Snow Leopard compatible version <a
href="http://patjack.co.uk/files/Toggle-Screensaver-Password-10-6.txt">here</a>). (Warning &#8211; it&#8217;s not the easiest thing to read!)</p><p><span
id="more-77"></span><p>This applescript toggles the screen-saver password, and then displays a growl notification telling you whether the password has been enabled or disabled &#8211; handy if you&#8217;ve pressed it one time too many and you&#8217;re not sure if your screen is locked or not!<br
/> </br><br
/> If you don&#8217;t have growl installed I suggest you download it now from <a
href="http://growl.info">here</a>!</p><p> If you&#8217;d prefer not to use growl, then just delete the two blocks of code between the <code><br
/> tell application "GrowlHelperApp"<br
/> </code> and the next <code><br
/> end tell<br
/> </code></p><p> I used quicksilver (download it <a
href="http://qsapp.com">here</a> if you haven&#8217;t already!) to create a trigger that means I only have to press a few keys to toggle the password. Works great!</p><h2 style="color:#ff0000">*** Update ***</h2><p> If you&#8217;ve downloaded this script and it isn&#8217;t working, it&#8217;s probably because you have different settings in your system preferences to me. To find out what yours are open up script editor (found in Applications/Applescript) and run this script <code></p><p>tell application "System Events"<br
/> tell security preferences<br
/> get properties<br
/> end tell<br
/> end tell</p><p></code><br
/> Hopefully you&#8217;ll get a message in the &#8216;result&#8217; log at the bottom of the script editor. The details in here should match the details on the 3rd line which starts with <code><br
/> if get properties is {require....<br
/> </code> except for the first item which should stay as <code><br
/> require password to wake:true,<br
/> </code></p><p>Enjoy <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h2 style="color:#ff0000">*** Note ***</h2><p><p> If you&#8217;re logged into a non-admin account, this will ask you for the password every time. Annoying, but hopefully bearable!</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/toggle-screensaver-password-applescript/feed/</wfw:commentRss> <slash:comments>19</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: patjack.co.uk @ 2012-05-19 12:28:29 -->
