<?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>Veritrope &#187; Productivity</title>
	<atom:link href="http://veritrope.com/tag/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://veritrope.com</link>
	<description>Tech, Arts, Travel</description>
	<lastBuildDate>Sun, 05 Sep 2010 03:22:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<cloud domain='veritrope.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Learn To Speak AppleScript, Part 2: Baby Steps</title>
		<link>http://veritrope.com/tips/learn-to-speak-applescript-part-2/</link>
		<comments>http://veritrope.com/tips/learn-to-speak-applescript-part-2/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 01:00:33 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apple Mail]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://veritrope.com/?p=3946</guid>
		<description><![CDATA[Part Two of a short tutorial on how AppleScript can streamline your work, make you more productive, and save you time!  This lesson focuses on how to plan a new script and prepare to write it!]]></description>
			<content:encoded><![CDATA[<blockquote>
<h3><a href="http://veritrope.com/tips/learn-to-speak-applescript" >Click Here To Read Part One of &#8220;Learn To Speak AppleScript&#8221;</a></h3>
</blockquote>
<p><img src="http://media.veritrope.com/wp-content/uploads/2009/11/apple_script.gif" alt="" title="applescript"  class="alignright size-full wp-image-3566" /><br />
To recap the end of <a href="http://veritrope.com/tips/learn-to-speak-applescript" >Part One</a>, your goal will be to build a script that will save your emails as text files.   The actual programming will be covered in Part Three and, when we get there, I&#8217;ll try to stay more &#8220;conceptual&#8221;.</p>
<p><em>My goal</em> will be to give you a feel for how an AppleScript does its job &#8212; but still include enough real-life code to keep it interesting for more experienced scripters (or for people who came here from a search engine looking for a bit of code to get their scripts up and running!)</p>
<p>But, if you <em>are</em> a beginner, don&#8217;t let those computer code snippets intimidate you!  They are included primarily so that you can see what a real-life Script looks like and not with any expectation that you master the intricacies of the AppleScript language.</p>
<p>After all, this is really an exercise in teaching you the fundamentals of <em>thinking and speaking</em> AppleScript.  In other words, this is going to be more like an English class in literature where we talk about books and what they mean &#8212; and <strong>not</strong> a grammar lesson.</p>
<p>In fact, that metaphor is actually a pretty good way to get started!<br />
<span id="more-3946"></span></p>
<h3>The First Step Is Between Your Ears</h3>
<p>As I mentioned in Part One, AppleScript is an &#8220;English-like&#8221; programming language.</p>
<p>What we are going to do in this lesson is to state our goals as clearly as we can &#8212; and do so in plain, everyday language.  Once we&#8217;ve done that, we&#8217;ll set about writing an AppleScript that matches up with that description.</p>
<blockquote><p>
<strong>Rule #1:</strong><br />
<em>First, we say it in English&#8230;. then we say it in &#8220;English-like&#8221;.</em>
</p></blockquote>
<p>Writing a good AppleScript is like&#8230;.  (wait for it) &#8230;. <em>writing a good <strong>anything</strong>!</em></p>
<p>Most things that are well-written have probably started from a place of being <em>well-thought-out</em>, right?  That&#8217;s not to say that you won&#8217;t discover some fun, unexpected stuff along the way &#8212; but <strong>actions begin with intentions</strong>.  My experience is this: The clearer you are about your intentions when you start, the more you&#8217;ll make the right choices along the way.<sup><a href="http://veritrope.com/tips/learn-to-speak-applescript-part-2/#footnote_0_3946"  id="identifier_0_3946" class="footnote-link footnote-identifier-link" title="I&amp;#8217;d like to welcome everyone to the Veritrope.com &amp;#8220;Den of Zen&amp;#8221;&amp;#8230;">1</a></sup></p>
<p>And the more likely you&#8217;ll end up with <em>a working thing</em> at the end of your journey.</p>
<h1>The Goal of the Script (In Plain English)</h1>
<p>First, we need to state our overall goal as clearly as we can.  For this first sample script, that goal is:</p>
<blockquote><p><strong>&#8220;I want a script that will save emails as text files.&#8221;</strong></p></blockquote>
<h3>The Basic Elements We&#8217;ll Need In the Script:</h3>
<p>Now that we know <em>what we want to do</em>, we&#8217;ll flesh out the details more fully:<br />
<span class="pullquote"><!--First, We Say It In English.... Then We Say It In "English-Like".--></span></p>
<ol>
<li>I use the Apple Mail application to read my emails.</li>
<li>I want to be able to save emails as text files.</li>
<li>I want to be able to save more than one email at a time.</li>
<li>I want to be able to control where the text files are saved to.</li>
<li>I want the new text files to have distinctive names so that I can tell them apart more easily.</li>
<li>I want the script to come up with those names so that I don&#8217;t have to do it for each file.</li>
</ol>
<h3>&#8220;I Four Years Old!&#8221;</h3>
<p>You&#8217;ll notice how explicit I was in calling out each part of what I wanted to do.</p>
<p><strong>This way of thinking in terms of &#8220;baby steps&#8221; towards your overall goal is probably the most important thing you can take from this lesson.</strong></p>
<p>Here&#8217;s why &#8212; AppleScript is great, but teaching it to do what you want it to do can be like <em>trying to teach a child</em>.   You really need to try and see things through the eyes of a kid (or, in this case, a computer that knows only what you tell it) in order to know how to communicate.</p>
<blockquote><p>
<strong>Rule #2:</strong><br />
<em>AppleScript is like an energetic child.  It&#8217;s eager to please &#8212; but in need of clear, constant direction.</em></p></blockquote>
<p>It reminds me a bit of that old Bill Cosby comedy routine about a kid named Jeffery:</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/Fs0cYJUqJys&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fs0cYJUqJys&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>If you have any hope of getting off the plane with your sanity intact, you&#8217;re going to have to learn how to translate your adult language into something a kid can understand.  That is to say, it&#8217;s something <em>you&#8217;re absolutely going to be able to do</em> &#8212; it&#8217;s just going to take a brief transition while you take a deep breath and mentally switch gears from your language and into theirs.</p>
<h3>Sometimes, Kids Just Don&#8217;t Understand</h3>
<p>I&#8217;ll make one more point using the &#8220;Talking To Kids Metaphor&#8221; as we end Part Two&#8230;</p>
<p>Every kid is different.<br />
Some are barely able to tie their shoes.<br />
Some come up to you and, unprompted, freak you out by asking if you&#8217;re an <a target="_blank" href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref_%3Dnb%5Fsb%5Fnoss%26y%3D0%26field-keywords%3Dexistentialist%26url%3Dsearch-alias%253Daps&#038;tag=veritrope-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957" >existentialist</a><img src="https://www.assoc-amazon.com/e/ir?t=veritrope-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>
<p>In the world of AppleScript, each of the applications on your Mac &#8212; programs like Apple Mail, Firefox, Evernote, iCal, etc. &#8212; are like kids at different grade levels.  And, although you can sometimes guess, you&#8217;ll never really know<em> which type of kid it is</em> until you start talking to them and figure out their vocabulary level.</p>
<p>And this is the point where, thankfully, reality departs from the metaphor:  In the computer world, you can<em> actually see which words an application knows ahead of time</em> &#8212; sparing you painful, Jeffery-like conversations.  When it comes to speaking AppleScript, each program keeps a list of the vocabulary it knows in <strong>an AppleScript Dictionary</strong>. (Easy to remember, right?)</p>
<h3>Ready To Talk?</h3>
<p>In Part Three, we&#8217;ll open up that dictionary and start having an AppleScript conversation with a fairly &#8220;well-spoken&#8221; kid on the Application playground &#8212; Apple Mail!</p>
<ol class="footnotes"><li id="footnote_0_3946" class="footnote">I&#8217;d like to welcome everyone to the Veritrope.com &#8220;Den of Zen&#8221;&#8230;</li></ol>]]></content:encoded>
			<wfw:commentRss>http://veritrope.com/tips/learn-to-speak-applescript-part-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Mac Users &#8212; Want To Get Things Done Faster? Learn to Speak AppleScript!</title>
		<link>http://veritrope.com/tips/learn-to-speak-applescript/</link>
		<comments>http://veritrope.com/tips/learn-to-speak-applescript/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 06:04:24 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apple Mail]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://veritrope.com/?p=3560</guid>
		<description><![CDATA[Part One of a short tutorial on how AppleScript can streamline your work, make you more productive, and save you time!]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.veritrope.com/wp-content/uploads/2009/11/apple_script.gif" alt="" title="applescript"  class="alignright size-full wp-image-3566" /><br />
<strong>Here&#8217;s something for both new and experienced Mac users &#8212; Part One of a short tutorial on how AppleScript can streamline your work, make you more productive, and save you time!</strong></p>
<h3>What Exactly <em>is</em> AppleScript?</h3>
<p>AppleScript is an English-like language used to write programs that control applications on your computer.  The &#8220;English-like&#8221; part is important &#8212; <em>it means that you don&#8217;t need to have a computer science degree to use it.</em><br />
<strong><br />
<blockquote>Simply put, it&#8217;s programming for regular people who want to <em>get things done faster</em>.</p></blockquote>
<p></strong><br />
<span id="more-3560"></span><br />
The programs that you write in AppleScript are called &#8220;scripts&#8221; (you saw that coming, right?).  Much like the script for a movie, an AppleScript is really just a list of instructions for your computer to follow.  It&#8217;s kind of like saying to your Mac, &#8220;Okay &#8212; when I say <em>this</em>, you need to <strong>do X, Y, and Z</strong>.&#8221;  Honestly, that&#8217;s all that <i>scripting</i> means&#8230;  giving your Mac a To-Do list.</p>
<p><strong>Best of all, it&#8217;s free!</strong>  Apple generously includes several tools that you&#8217;ll need to get started with automating tasks on your Mac &#8212; including the AppleScript Editor, which is used to write and save new AppleScripts for your computer to follow.</p>
<h3>What is AppleScript Good For?</h3>
<p>If you&#8217;ve ever known the soul-sucking drudgery of having to perform the same tasks over-and-over again on your computer, then AppleScript is for you!  <strong>AppleScript automates repetitive tasks for you.</strong>  So, instead of wasting time doing everything by hand, your computer does it for you&#8230;</p>
<p>(This is, after all, what they are <em><strong>supposed to do</strong> in the first place</em>. <img src='http://veritrope.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  )</p>
<p>Need to change the names of 100 files?  You can either spend <em>the next hour clicking and typing yourself into <strong>carpal-tunnel-induced dementia</strong><sup><a href="http://veritrope.com/tips/learn-to-speak-applescript/#footnote_0_3560"  id="identifier_0_3560" class="footnote-link footnote-identifier-link" title="This is not a real condition&amp;#8230;I hope!">1</a></sup> </em> &#8212; or spend 2 minutes to write a script, click a button, and it&#8217;s done!</p>
<p>Most programs on the Mac have at least some level of support for AppleScript and, if you look around <a href="http://veritrope.com" >Veritrope.com</a>, you&#8217;ll see <a href="http://veritrope.com/tag/applescript" >AppleScripts</a> that I&#8217;ve written to work with (and to connect together) many popular Mac applications.   There are literally thousands of AppleScripts available to automate your system (most of them free!).</p>
<p>And, if by some chance you can&#8217;t find a script that someone else has written to automate a particular task, it really is easy enough to write one for yourself.</p>
<h3>How do I learn AppleScript?</h3>
<p>People often write me asking &#8220;How did you learn AppleScript?&#8221;</p>
<p>The simple answer is that I started <em><strong>reading</strong> AppleScripts</em> written by people who knew what they were doing.  The more that I read, the more I understood what was possible &#8212; and also some of the things you needed to make a working script.</p>
<p>
In other words &#8212; <strong><span class="pullquote">Before I could really speak AppleScript, I started to learn how to **THINK** AppleScript</span></strong>.  It&#8217;s really not any different than if you were dropped into a place where you didn&#8217;t know the language.  You&#8217;d probably understand what the people around you <em>were getting at</em> &#8212;   long before you learned enough of the language to make yourself understood.
</p>
<h3>How To Learn The Language</h3>
<p>
The quasi-official <a target="_blank" href="http://www.macosxautomation.com/" >macosxautomation.com</a> site is probably the best place to get started.  It has <strong>lots</strong> of introductory tutorials and code examples for the beginning AppleScripter &#8212; but also some great introductions to other utilities that really set the Mac apart (like Automator and Services).</p>
<p>People like <a target="_blank" href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref_%3Dnb%5Fsb%5Fnoss%26y%3D0%26field-keywords%3Dben%2520waldie%26url%3Dsearch-alias%253Daps&#038;tag=veritrope-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957" >Ben Waldie</a><img src="https://www.assoc-amazon.com/e/ir?t=veritrope-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> (a guru of AppleScript and <a target="_blank" href="http://www.automatedworkflows.com/" >Mac Automation</a>) &#8212; as well as any number of people who post on <a target="_blank" href="http://macscripter.net/" >the MacScripter forum</a> &#8212; also really helped me get going.  I was truly inspired by their projects&#8230; and also by the community that they maintained to help new people like me get started.</p>
<p>As I started to <em>really</em> get more into it, I also found some great <a target="_blank" href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref_%3Dnb%5Fsb%5Fnoss%26y%3D0%26field-keywords%3DAppleScript%26url%3Dsearch-alias%253Daps&#038;tag=veritrope-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957" >books about AppleScript</a><img src="https://www.assoc-amazon.com/e/ir?t=veritrope-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> (Especially <a target="_blank" href="http://www.amazon.com/gp/product/0321149319?ie=UTF8&#038;tag=veritrope-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0321149319" >Sal Soghoian&#8217;s &#8220;AppleScript 1-2-3&#8243;</a><img src="http://www.assoc-amazon.com/e/ir?t=veritrope-20&#038;l=as2&#038;o=1&#038;a=0321149319" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />)</p>
<h3>Learning How To Think</h3>
<p>All of the resources that I just mentioned are <strong><em>the</em></strong> places to learn the actual ins-and-outs of programming in AppleScript&#8230; Honestly, you really can&#8217;t do much better than all of these great, talented teachers!  Read what they have to say &#8212; and they&#8217;ll whip your scripting vocabulary and programming grammar into shape before you know it!</p>
<p>What I&#8217;d like to do here is a little different: I want to try and <em><strong>teach you how to think in AppleScript</strong></em> so that, while you&#8217;re learning from these great resources, you&#8217;ll have an existing framework for understanding what they&#8217;re trying to teach you.  That way when it comes time to write your own scripts, you&#8217;ll hopefully have a stronger sense of what your looking for and, what&#8217;s more, the types of scripts you&#8217;ll need to put together to make it all work.</p>
<p>In <a href="http://veritrope.com/tips/learn-to-speak-applescript-part-2" >Part Two of this series</a>, we&#8217;re going to start to build our first sample script: <strong>An AppleScript that will save your emails as text files!</strong></p>
<ol class="footnotes"><li id="footnote_0_3560" class="footnote">This is not a real condition&#8230;I hope!</li></ol>]]></content:encoded>
			<wfw:commentRss>http://veritrope.com/tips/learn-to-speak-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: veritrope.com @ 2010-09-06 04:08:43 -->