<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel>
	  <title>Ask MetaFilter questions tagged with applescript</title>
      <link>http://ask.metafilter.com/tags/applescript</link>
      <description>Questions tagged with 'applescript' at Ask MetaFilter.</description>
	  <pubDate>Mon, 26 Oct 2009 09:54:00 -0800</pubDate> <lastBuildDate>Mon, 26 Oct 2009 09:54:00 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>Help me write a script in OSX</title>
	<link>http://ask.metafilter.com/136469/Help%2Dme%2Dwrite%2Da%2Dscript%2Din%2DOSX</link>	
	<description>How do I create a file-handling script in OSX? I want to create a script that will throw whatever is in my CF card in the trash, empty the recycle bin and then eject the card. &lt;br&gt;
I frequently transfer pictures from my card to my computer and with lightroom 2 they don&apos;t automatically erase off the card so I need to do it by hand.&lt;br&gt;
I find that if I trash the files on the card and DON&apos;T empty the recycle bin the data stays held up in the card and eventually have to format it. &lt;br&gt;
&lt;br&gt;
Are there any other options? If not, how would I write a script. I tried &quot;recording&quot; a script in Applescript Editor but that didn&apos;t work at all.&lt;br&gt;
&lt;br&gt;
Thanks!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.136469</guid>
	<pubDate>Mon, 26 Oct 2009 09:54:00 -0800</pubDate>
	<category>applescript</category>
	<category>editor</category>
	<category>OSX</category>
	<category>script</category>
	<dc:creator>Thrillhouse</dc:creator>
	</item>
	<item>
	<title>I Wish I Could Just Throw It At the &apos;Net</title>
	<link>http://ask.metafilter.com/135585/I%2DWish%2DI%2DCould%2DJust%2DThrow%2DIt%2DAt%2Dthe%2DNet</link>	
	<description>Auomating Mac Filter: I want to upload a movie to a free video sharing site from the command line. How? I currently have a system where I email an image to my Mac Mini which upload the image to TinyPic then Twitters the caption and image URL: (&quot;This is a cool picture! - http://bt.ly/example&quot;)&lt;br&gt;
&lt;br&gt;
I want to do the same thing with videos. The only problem is that I do not know how to automate uploading a short video to a video sharing site. I found &lt;a href=&quot;http://eagain.net/blog/2006/11/13/revver-upload-video.html&quot;&gt;this python script&lt;/a&gt; to upload a video to Revver, but using the following command, I cannot get the video to upload:&lt;br&gt;
&lt;br&gt;
&lt;small&gt;python /Users/example/RevverExamplePython/revver-upload-video.py /Users/example/revverupload/movie.3gp --login Username --passphrase-file /Users/example/revverpassphrase.txt --age-rating 1 --title test --tag test --author test --url http://www.example.com/ --credits test --description test&lt;/small&gt;&lt;br&gt;
&lt;br&gt;
Which returns an unnamed error. So, in the end, I want a system to upload a video to any video sharing site and return the URL (or video id) for that video. Help?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.135585</guid>
	<pubDate>Thu, 15 Oct 2009 14:33:21 -0800</pubDate>
	<category>applescript</category>
	<category>automation</category>
	<category>mac</category>
	<category>python</category>
	<category>videouploading</category>
	<dc:creator>47triple2</dc:creator>
	</item>
	<item>
	<title>Help me get my feeds home.</title>
	<link>http://ask.metafilter.com/124241/Help%2Dme%2Dget%2Dmy%2Dfeeds%2Dhome</link>	
	<description>How do I export a whole bunch of Home URLs from NetNewsWire, or an alternate RSS feeder for the Mac? So I have a lot of subscribed blogs in NNW. I wanted to send a list of the websites that they&apos;re from to someone. I thought I could do this easily in NNW. I was wrong. &lt;br&gt;
&lt;br&gt;
I&apos;ve never used Applescript before, but I tried hacking the included Applescript files. There is an appropriate property (home URL), and I can get it to export the Home URL for the current selected feed, but if I select several, it just gives me the last one I clicked on, and if I select a group, it just gives me an error. I have several hundred feeds to export from, and this seems an absurdly inelegant solution.&lt;br&gt;
&lt;br&gt;
Can anyone help me here? I tried exporting an OMPL file and attacking it with Applescript, but being a complete newbie, I can&apos;t figure out how on earth to get the info out of it. Any help would be much appreciated!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.124241</guid>
	<pubDate>Mon, 08 Jun 2009 15:22:17 -0800</pubDate>
	<category>applescript</category>
	<category>export</category>
	<category>homeurl</category>
	<category>netnewswire</category>
	<category>resolved</category>
	<dc:creator>Magnakai</dc:creator>
	</item>
	<item>
	<title>trimming podcasts in quicktime</title>
	<link>http://ask.metafilter.com/123636/trimming%2Dpodcasts%2Din%2Dquicktime</link>	
	<description>I have a podcast (M4A format) that I&apos;d like to trim and save without re-encoding. Is this possible? In Quicktime Pro I can select a time range, trim it, and choose save, but it saves the resulting file as a .MOV file. Basically I want to grab a chapter of the podcast and have it as a regular audio file. Eventually this will be done in AppleScript.&lt;br&gt;
&lt;br&gt;
Is the .MOV simply a wrapper? It looks as though I can change the file extension to M4A and it loads fine. Do I have to manually change the extension each time? What podcast info has to be removed for iTunes to load it as a regular file and not load it into the podcast section?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.123636</guid>
	<pubDate>Mon, 01 Jun 2009 20:06:57 -0800</pubDate>
	<category>apple</category>
	<category>applescript</category>
	<category>itunes</category>
	<category>m4a</category>
	<category>podcast</category>
	<category>quicktime</category>
	<dc:creator>krunk</dc:creator>
	</item>
	<item>
	<title>An AppleScript a day will eventually cause a visit to the doctor.</title>
	<link>http://ask.metafilter.com/120855/An%2DAppleScript%2Da%2Dday%2Dwill%2Deventually%2Dcause%2Da%2Dvisit%2Dto%2Dthe%2Ddoctor</link>	
	<description>In Word 2008, how can I set up an AppleScript macro to move selected text so that it appears underneath a particular bookmark? I have no problem cutting the selection or assigning the content of the text object of the selection to a variable.  The question is, assuming I know the bookmark name, how can I jump through the document to a specific bookmark, insert a carriage return, and paste the cut object to appear directly below the bookmark?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.120855</guid>
	<pubDate>Wed, 29 Apr 2009 14:22:22 -0800</pubDate>
	<category>applescript</category>
	<category>word</category>
	<dc:creator>I EAT TAPAS</dc:creator>
	</item>
	<item>
	<title>Need to automate a weekly task using AppleScript</title>
	<link>http://ask.metafilter.com/118012/Need%2Dto%2Dautomate%2Da%2Dweekly%2Dtask%2Dusing%2DAppleScript</link>	
	<description>I need to automate the process of printing a report to PDF with the date in the file name, saving it in an archive folder, printing it, and emailing it as an attachment. I am on a Mac and using Pages, Automator, and AppleScript. Help me find the missing pieces! I have to write a report each Friday for work and send it as an attachment to a specific email address where it gets processed by an internal server. Usually my process is as follows:&lt;br&gt;
&lt;br&gt;
1. Write report in Pages.&lt;br&gt;
2. Print report as PDF to a specific folder using OS X&apos;s built-in capabilities.&lt;br&gt;
3. Name the PDF file based on the date.&lt;br&gt;
4. Print the PDF file to a hard copy.&lt;br&gt;
5. Attach the PDF to an email using Mail and send it.&lt;br&gt;
&lt;br&gt;
I realize that&apos;s not a ton of work, but this Friday I felt the urge to automate the process. At first I wanted to do it to save myself some time, and then once I had spent an hour trying to figure it out it became more of a challenge, and then after spending another hour on it I didn&apos;t care about solving the problem myself and just wanted a solution by any means necessary.&lt;br&gt;
&lt;br&gt;
Most of the individual pieces of this automated task are not difficult to accomplish, but I have found it difficult to get each step to talk to the next. I have also had trouble due to the fact that I want to make the file name of the saved PDF contain the date it was saved. I&apos;m sure this would be easy for anyone who has used AppleScript extensively, but I&apos;m just a beginner at it so it&apos;s baffling me.&lt;br&gt;
&lt;br&gt;
Could someone help me figure out the proper script structure to make all this work? If it matters, I am using the latest version of OS X and Pages. The files need to be saved with the name &quot;weekly_report_MM_DD_YYYY.pdf&quot; (it doesn&apos;t have to be exact, just something along those lines) and the email that it is attached to doesn&apos;t need anything in it except for a recipient. If I&apos;ve forgotten any necessary details, please let me know and I&apos;ll provide them.&lt;br&gt;
&lt;br&gt;
HELP!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.118012</guid>
	<pubDate>Sat, 28 Mar 2009 20:20:15 -0800</pubDate>
	<category>apple</category>
	<category>applescript</category>
	<category>automation</category>
	<category>automator</category>
	<category>mac</category>
	<category>scripting</category>
	<dc:creator>joshrholloway</dc:creator>
	</item>
	<item>
	<title>How can I automatically add tracks to the OS X iTunes Library?</title>
	<link>http://ask.metafilter.com/106827/How%2Dcan%2DI%2Dautomatically%2Dadd%2Dtracks%2Dto%2Dthe%2DOS%2DX%2DiTunes%2DLibrary</link>	
	<description>Is there a scriptable solution to add items to the OS X iTunes library? I am in the process of switching management of my iPod from my older XP desktop to my MacBook.  For a couple of years now I have been using a homegrown Perl program to download podcasts, and then running the console version of &lt;a href=&quot;http://itlu.ownz.ch/wordpress/&quot;&gt;iTunes Library Updater&lt;/a&gt; as a scheduled task to automatically add them to the iTunes library.   It&apos;s great -- works totally in the background, and when I sync my iPod everything is Just There.&lt;br&gt;
&lt;br&gt;
I&apos;d like to duplicate this process on my MacBook.  The Perl script obviously ports fine, and I can schedule it using cron, but I can&apos;t find a way to automatically add items to the iTunes library.  Some things I&apos;ve considered:&lt;br&gt;
&lt;br&gt;
-- iTLU is written in .NET, so that&apos;s out (unless it runs under mono -- but I fear that way lies madness.)  &lt;br&gt;
&lt;br&gt;
-- At &lt;a href=&quot;http://dougscripts.com/itunes/&quot;&gt;Doug&apos;s Applescripts&lt;/a&gt;, the suggested solution is to &lt;a href=&quot;http://dougscripts.com/itunes/itinfo/folderaction01.php&quot;&gt;add a folder action&lt;/a&gt; to the folder you want to watch.  However, my understanding is that folder actions only work if the folder is actively being worked with in the Finder (open, having things dropped on it, etc.), so adding files to my podcast folder behind the scenes won&apos;t trigger a folder action. &lt;br&gt;
&lt;br&gt;
-- There&apos;s a Mac::iTunes module on CPAN, but it looks pretty unfinished (for instance, under &quot;Bugs&quot; for Mac::iTunes::Library::Write it says &quot;just wait&quot;.)  &lt;br&gt;
 &lt;br&gt;
This is for a MacBook running Leopard.  Any suggestions?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.106827</guid>
	<pubDate>Fri, 14 Nov 2008 14:05:26 -0800</pubDate>
	<category>applescript</category>
	<category>iTLU</category>
	<category>itunes</category>
	<category>ituneslibraryupdater</category>
	<category>mac</category>
	<category>osx</category>
	<category>Perl</category>
	<category>podcast</category>
	<category>resolved</category>
	<dc:creator>harkin banks</dc:creator>
	</item>
	<item>
	<title>Can an Automator Workflow/App Find Itself?</title>
	<link>http://ask.metafilter.com/100816/Can%2Dan%2DAutomator%2DWorkflowApp%2DFind%2DItself</link>	
	<description>Obscure Mac geekery filter...  On OS X Leopard, how can I get a reference to the current location of an Automator workflow/app in a shell script within that workflow? I&apos;ve got a complex Automator workflow that currently has to move files in and out of various directories.  Currently these directories live in a specific location that&apos;s hard coded into the workflow.  What I&apos;d like to do is have the workflow be able to reference it&apos;s own package and create the directories it needs inside itself (ex. /some/random/path/myworkflow.workflow/Contents/niftyFolders) or, barring that, just create the directories in the same directory the workflow itself is currently in.  Unfortunately I can&apos;t find a way to get the location of the workflow itself.&lt;br&gt;
&lt;br&gt;
I&apos;m thinking the most likely way to do it at this point is with AppleScript, and I&apos;ve looked into that a little, but have come up empty.  AppleScript and I have never clicked, so I thought I&apos;d turn to all of you.&lt;br&gt;
&lt;br&gt;
Thanks!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.100816</guid>
	<pubDate>Wed, 03 Sep 2008 12:06:13 -0800</pubDate>
	<category>applescript</category>
	<category>automator</category>
	<category>directories</category>
	<category>folders</category>
	<category>leopard</category>
	<category>mac</category>
	<dc:creator>Xuff</dc:creator>
	</item>
	<item>
	<title>Create local finder links for mail.app</title>
	<link>http://ask.metafilter.com/95980/Create%2Dlocal%2Dfinder%2Dlinks%2Dfor%2Dmailapp</link>	
	<description>A few of us work off a local OS X Fileserver. We often need to point each other to files deep with it by email. I am looking for an automated way to create clickable local links in the mail.app friendly format of &quot;file:///Volumes/Server%20Portal/&quot;. Any solutions?

I have found &lt;a href=&quot;http://www.macosxhints.com/article.php?story=20070416161655621&quot;&gt;applescripts&lt;/a&gt; that nearly do it.  But they only make POSIX links. For Mail to recognise and launch links they need both file:/// appended and spaces replaced with %20. I am guessing it could be achieved by a few additions to current applescripts, but unfortunately it is above me.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.95980</guid>
	<pubDate>Mon, 07 Jul 2008 18:35:07 -0800</pubDate>
	<category>applescript</category>
	<category>finder</category>
	<category>leopard</category>
	<category>mail</category>
	<category>mailapp</category>
	<category>osx</category>
	<dc:creator>Raff</dc:creator>
	</item>
	<item>
	<title>Coloring an OSX Terminal window based on an ssh connection?</title>
	<link>http://ask.metafilter.com/91501/Coloring%2Dan%2DOSX%2DTerminal%2Dwindow%2Dbased%2Don%2Dan%2Dssh%2Dconnection</link>	
	<description>My career involves me using OSX Terminal ssh&apos;d into other servers.  Often, I have multiple ssh connections open, sometimes two or three to the same server.  I can&apos;t bring myself to use tabs.  Is there anything that can automatically be done to automatically color/title my terminal windows once I ssh into them? Even nicer would be a spotlight command to launch terminal and connect to a terminal.  Then, the color/background image (and window title) would change based on my ssh connection, depending on server name/address, production vs qa vs dev, etc.  We&apos;re talking about 10 diff. servers overall and often I have two or three terminals open to the same server.&lt;br&gt;
&lt;br&gt;
Is this the reason I&apos;ve been needing to finally delve into Applescript, or does a solution already exist?&lt;br&gt;
&lt;br&gt;
I would consider installing QS if a solution exists.  If it helps, I dont do a whole lot locally from the OSX terminal, its always ssh.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.91501</guid>
	<pubDate>Thu, 15 May 2008 12:45:17 -0800</pubDate>
	<category>applescript</category>
	<category>osx</category>
	<category>ssh</category>
	<category>terminal</category>
	<dc:creator>neilkod</dc:creator>
	</item>
	<item>
	<title>Applescript MIA</title>
	<link>http://ask.metafilter.com/81512/Applescript%2DMIA</link>	
	<description>My Macbook says my AppleScript version is outdated (1.1.0). How can this be? And how can I fix it/download an update? I know that I should at least have something like 1.10, but I&apos;m guessing that it&apos;s bug. All roads travelled lead to release notes only. </description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.81512</guid>
	<pubDate>Mon, 21 Jan 2008 04:09:58 -0800</pubDate>
	<category>applescript</category>
	<dc:creator>drea</dc:creator>
	</item>
	<item>
	<title>One touch shutdown</title>
	<link>http://ask.metafilter.com/78158/One%2Dtouch%2Dshutdown</link>	
	<description>Asking for Mr Waterlily: &quot;I would like write a script that starts when the computer starts, goes into a permanent loop, looks to see if a key is pressed, if the key is pressed it would do something, if not it would pause n seconds then loop again. 

How does one detect key events in applescript?&quot; &quot;I am running system 9.1. &quot;&lt;br&gt;
&lt;br&gt;
This is for a digital photo frame project made from an old powerbook 1400 we had lying around, if that&apos;s at all relevant.  He wants it to automatically turn off the machine when a key is pressed (just shutting down instantly without bringing up any menus or options as the power button would).  We are not mac people so if there&apos;s something easier he&apos;s missing, please advise.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.78158</guid>
	<pubDate>Sat, 08 Dec 2007 16:22:51 -0800</pubDate>
	<category>applescript</category>
	<category>powerbook</category>
	<category>shutdown</category>
	<dc:creator>waterlily</dc:creator>
	</item>
	<item>
	<title>Is it possible to export an .ics file from iCal containing just today&apos;s events from specific calendars?</title>
	<link>http://ask.metafilter.com/75414/Is%2Dit%2Dpossible%2Dto%2Dexport%2Dan%2Dics%2Dfile%2Dfrom%2DiCal%2Dcontaining%2Djust%2Dtodays%2Devents%2Dfrom%2Dspecific%2Dcalendars</link>	
	<description>Is it possible to export an .ics file from iCal containing just today&apos;s events from specific calendars? I assumed I&apos;d be able to do this with Automator, but it doesn&apos;t have any actions for exporting from iCal.&lt;br&gt;
&lt;br&gt;
So is there a way to do this, perhaps with Applescript? I&apos;ve tried Googling to no avail - there seem to be plenty of scripts to export todo items in various ways, but nothing regarding calendars for a given date that I could find.&lt;br&gt;
&lt;br&gt;
Alternatively, is it possible to make a new &apos;daily&apos; calendar containing all today&apos;s events from specific calendars (and nothing else), which I could then export manually? Again, I can&apos;t get Automator to do this - the New iCal Events action won&apos;t take input from Filter Items in iCal or Get Specified iCal Items.&lt;br&gt;
&lt;br&gt;
I&apos;m running iCal 3.0 on OS 10.5.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.75414</guid>
	<pubDate>Sun, 04 Nov 2007 11:28:39 -0800</pubDate>
	<category>applescript</category>
	<category>automator</category>
	<category>export</category>
	<category>ical</category>
	<category>leopard</category>
	<category>osx</category>
	<category>stumped</category>
	<category>ultrastumped</category>
	<category>unanswered</category>
	<dc:creator>jack_mo</dc:creator>
	</item>
	<item>
	<title>AppleScript n00b needs troubleshooting help</title>
	<link>http://ask.metafilter.com/75254/AppleScript%2Dn00b%2Dneeds%2Dtroubleshooting%2Dhelp</link>	
	<description>15-line AppleScript is giving this n00b nightmares. I think something&apos;s wrong with my &quot;if ... then&quot; syntax. What I&apos;m trying to do (embarrassingly enough) is write a &quot;Pay attention, blockhead!&quot; script that will disable my Macbook&apos;s AirPort wireless card and re-enable it only upon correctly typing in an arbitrarily-long string of characters. Good for maintaining focus in lectures, y&apos;know?&lt;br&gt;
&lt;br&gt;
Anyway, here&apos;s what&apos;s I&apos;ve got after teaching myself AppleScript for an hour and snatching several snippets: &lt;a href=&quot;http://pastebin.com/m22518315&quot;&gt;syntax-highlighted version&lt;/a&gt;, or T&lt;a href=&quot;http://www.qwantz.com/archive/001078.html&quot;&gt;i&lt;/a&gt;ny Towne version below for future readers, after that link goes bad:&lt;br&gt;
&lt;code&gt;&lt;small&gt;&lt;small&gt;&lt;br&gt;
do shell script &quot;scselect AirPort-Off&quot; --This selects a network location for which I&apos;ve disabled AirPort&lt;br&gt;
set randphrase to {}&lt;br&gt;
repeat (random number from 1 to 2) times --This loop generates the random phrase. It&apos;s set to give only a few characters now for testing purposes.&lt;br&gt;
set end of randphrase to some item of &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&amp;amp;*()&quot;&lt;br&gt;
end repeat&lt;br&gt;
set alert_message to (&quot;Airport:&quot; &amp;amp; return &amp;amp; return)&lt;br&gt;
set alert_message to alert_message &amp;amp; randphrase&lt;br&gt;
display dialog alert_message default answer &quot;&quot; buttons {&quot;OK&quot;} default button 1 with icon 1 --This shows the window with the challenge phrase and a text box&lt;br&gt;
set userstypedphrase to text returned of the result&lt;br&gt;
if randphrase = userstypedphrase then --This *should* reactivate wireless if the users&apos; input is the same as the random phrase&lt;br&gt;
	do shell script &quot;scselect 0&quot;&lt;br&gt;
else if randphrase &#8800; userstypedphrase then --But, this one comes up no matter what.&lt;br&gt;
	display dialog &quot;Wrong.&quot;&lt;br&gt;
end if&lt;br&gt;
&lt;/small&gt;&lt;/small&gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
So, basically, I&apos;m trying to turn wireless off (this works), generate a random phrase (this works), bring up an input field (this works), and if the input matches the random phrase, turn wireless back on (this doesn&apos;t work). To troubleshoot, I&apos;ve inserted a line, &quot;&lt;code&gt;display dialog userstypedphrase &amp;amp; return &amp;amp; randphrase&lt;/code&gt;,&quot; which confirms that the two variables are the same. But nevertheless, it always evaluates them as different, and takes the &quot;&lt;code&gt;else&lt;/code&gt;&quot; fork.&lt;br&gt;
&lt;br&gt;
What am I doing wrong here? I&apos;ve scripted a few things before, so I thought I could handle this, but I just can&apos;t see how the two variables can&apos;t be made equal!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.75254</guid>
	<pubDate>Fri, 02 Nov 2007 06:28:34 -0800</pubDate>
	<category>airport</category>
	<category>applescript</category>
	<category>ifthen</category>
	<category>script</category>
	<category>troubleshoot</category>
	<category>wireless</category>
	<dc:creator>electric_counterpoint</dc:creator>
	</item>
	<item>
	<title>Help me batch process files and folders with Applescript</title>
	<link>http://ask.metafilter.com/74071/Help%2Dme%2Dbatch%2Dprocess%2Dfiles%2Dand%2Dfolders%2Dwith%2DApplescript</link>	
	<description>I have a folder of about two thousand .png files. For each file, I need to (1)create a new folder named the same as the currently selected file(minus the extension), and (2)move the file into its eponymous folder. How can I accomplish this using Applescript?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.74071</guid>
	<pubDate>Wed, 17 Oct 2007 20:01:04 -0800</pubDate>
	<category>applescript</category>
	<category>computers</category>
	<category>macOSX</category>
	<dc:creator>40 Watt</dc:creator>
	</item>
	<item>
	<title>Control USB Power based on temperature monitoring in Mac OS X</title>
	<link>http://ask.metafilter.com/73936/Control%2DUSB%2DPower%2Dbased%2Don%2Dtemperature%2Dmonitoring%2Din%2DMac%2DOS%2DX</link>	
	<description>I have a laptop cooling fan which runs on USB power. It works well but it&apos;s a fairly monotonous drone. The internal fans are linked to the cooling unit and the temperature monitor, so they operate based on the current temperature. Is there any way I can control the USB fan based on temperature as well? MacBook Pro 2.16GHz 2GB RAM C2D running Mac OS X 10.4.10&lt;br&gt;
&lt;br&gt;
I am really looking for an easy way to control power to the USB port based on temperature monitoring. At the most fundamental level, I&apos;d like to do is write the following (in AppleScript, Cocoa Objective-C, Java, etc.):&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&lt;br&gt;
temperature = TempMonitor.temp();&lt;br&gt;
&lt;br&gt;
if (someUSBIdentifier == FAN) {&lt;br&gt;
    if (temperature &lt;&gt; someUpperLimit) {&lt;br&gt;
        USB.port(2).power = on;&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
&lt;/&gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
I&apos;d like to find some way to identify the fan through the port, so that I don&apos;t end up powering off an external laptop just because the machine heats up. I&apos;ve looked through the System Profiler and can&apos;t find any identifying information for it, so I was wondering if there is some other profile or fingerprint I can pick up. &lt;br&gt;
&lt;br&gt;
I&apos;ve installed the Mac OS X USB SDK 1.8.7 for XCode and I will play around with that, but I was just looking to see if anyone had any ideas. Thanks.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.73936</guid>
	<pubDate>Tue, 16 Oct 2007 11:17:58 -0800</pubDate>
	<category>applescript</category>
	<category>mac</category>
	<category>power</category>
	<category>usbfan</category>
	<dc:creator>Mr. Banana Grabber</dc:creator>
	</item>
	<item>
	<title>&apos;Date Created&apos; -&gt; &apos;Date Modified&apos;</title>
	<link>http://ask.metafilter.com/68713/Date%2DCreated%2DDate%2DModified</link>	
	<description>I have Mac OS X, with its Unix underpinnings.  I have a number of text files through which I did a search-and-replace.  Unfortunately, that altered all of the timestamps on the files.  I&apos;m trying to restore things via the &quot;Date Created&quot; info. But my Google-fu is experiencing massive failure, perhaps due to the wrong terms.  Can this be done via &quot;touch&quot;, or is the &quot;date created&quot; info not accessible via the shell script?  Is it AppleScriptable?&lt;br&gt;
&lt;br&gt;
I&apos;m sure someone&apos;s already had to do this and put it up on the Web somewhere &#8212; I just can&apos;t find the puppy.&lt;br&gt;
&lt;br&gt;
(Also, hoping that the solution is one that can be applied to multiple files in a batch situation.)&lt;br&gt;
&lt;br&gt;
Thanks, everyone.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.68713</guid>
	<pubDate>Mon, 06 Aug 2007 21:48:18 -0800</pubDate>
	<category>applescript</category>
	<category>created</category>
	<category>date</category>
	<category>macosx</category>
	<category>modified</category>
	<category>resolved</category>
	<category>unix</category>
	<dc:creator>WCityMike</dc:creator>
	</item>
	<item>
	<title>Applescript+Excel+Pivot Table</title>
	<link>http://ask.metafilter.com/66817/ApplescriptExcelPivot%2DTable</link>	
	<description>Applescript + Excel . How to suppress subtotals for a field in a pivot table? Given a generic pivot table with row fields A, B and C and data field D, I want to be able to hide the subtotals in the row fields (equivalent to double-clicking the header and selecting &quot;None&quot;).&lt;br&gt;
&lt;br&gt;
According to Microsoft&apos;s &lt;a href=&quot;http://www.microsoft.com/mac/resources/resources.aspx?pid=asforoffice&quot;&gt;reference guide&lt;/a&gt;, there is no option for &quot;None.&quot; However, I can&apos;t even get one of the listed options to work. The example given on page 240 of the reference guide generates an error message. The following command does absolutely nothing:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;set subtotals pivot field &quot;A&quot; of pivot table 1 of active sheet subtotal index average subtotal&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Google seems to think that nobody has ever wanted to do such a thing.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.66817</guid>
	<pubDate>Thu, 12 Jul 2007 08:57:49 -0800</pubDate>
	<category>applescript</category>
	<category>excel</category>
	<category>pivottable</category>
	<dc:creator>cdavis</dc:creator>
	</item>
	<item>
	<title>Stripping some (but not all) formatting from rtf text (on a mac).</title>
	<link>http://ask.metafilter.com/61791/Stripping%2Dsome%2Dbut%2Dnot%2Dall%2Dformatting%2Dfrom%2Drtf%2Dtext%2Don%2Da%2Dmac</link>	
	<description>Is it possible to programmatically strip some (but not all) of the formatting from text that&apos;s been copied from safari? So you know how when you copy and paste from Safari to Textedit (or another rtf-aware program), all the formatting comes through -- the links, the italics, images, etc?&lt;br&gt;
&lt;br&gt;
I want to programmatically strip out all the formatting except the bolds and italics -- most importantly, to strip out the hyperlinks and images.  I&apos;m going to be copying a lot of text, so basically I just want this to be the push of a button.&lt;br&gt;
&lt;br&gt;
Writing a script for textedit itself is out: the rtf is opaque (the only option is just to convert it to plain text, and I&apos;ll lose the italics).  Nisus Writer Pro (beta) yields a similar roadblock (though if I could call up a contextual menu for each word using GUI scripting the problem&apos;s solved -- I don&apos;t think this is possible).  I&apos;d rather not use word because it&apos;s crashy under rosetta.  Suggestions?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.61791</guid>
	<pubDate>Wed, 02 May 2007 01:55:16 -0800</pubDate>
	<category>applescript</category>
	<category>mac</category>
	<category>osx</category>
	<category>safari</category>
	<category>scripting</category>
	<dc:creator>Tlogmer</dc:creator>
	</item>
	<item>
	<title>Is there a PC equivalent to AppleScript?</title>
	<link>http://ask.metafilter.com/47224/Is%2Dthere%2Da%2DPC%2Dequivalent%2Dto%2DAppleScript</link>	
	<description>Is there a Windows scripting language that is equivalent to AppleScript? I&apos;ve written an AppleScript script, that is basically an automated clicker in Safari.  It uses the &quot;do Javascript&quot; command to evaluate a web page to decide where to click, and also does some other actions outside of Safari.  I&apos;d like to write the same kind of program on the multiple PCs that we have at work, but I don&apos;t know what the equivalent language is in Windows.   Can anyone tell me where to begin looking and what good resources there are for Windows programming?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.47224</guid>
	<pubDate>Mon, 25 Sep 2006 09:16:24 -0800</pubDate>
	<category>applescript</category>
	<category>windows</category>
	<dc:creator>hooray</dc:creator>
	</item>
	<item>
	<title>How to make this automator action?</title>
	<link>http://ask.metafilter.com/41273/How%2Dto%2Dmake%2Dthis%2Dautomator%2Daction</link>	
	<description>Tearing my hair out over automator and applescript. I&apos;m trying to create an action that will change my desktop background: display photos of morning scenes in the morning, evening scenes in the evening, day scenes in the day, etc.&lt;br&gt;
&lt;br&gt;
I&apos;ve glue-sticked together an applescript that will find out the time and and put it in a variable as one of three words: morning, day, evening and night.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;&lt;code&gt;set TheDate to current date&lt;br&gt;
set theDateText to TheDate as text&lt;br&gt;
set theTime to time of TheDate&lt;br&gt;
set theHour to theTime div 3600&lt;br&gt;
&lt;br&gt;
if theHour &amp;gt; 6 and theHour &lt; 11 then set thename to morning end if if thehour&gt; 10 and theHour &lt; 19 then set thename to day end if if thehour&gt; 18 and theHour &lt; 23 then set thename to evening end if if thehour&gt; 22 then&lt;br&gt;
	set theName to &quot;night&quot;&lt;br&gt;
end if&lt;br&gt;
&lt;br&gt;
if theHour &lt; 7 then set thename to night end if/code&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/code&gt;&lt;/small&gt;&lt;br&gt;
&lt;br&gt;
But I can&apos;t for the life of me figure out how to get that variable into the next automator step, even though I have folders in ~/Backgrounds named &quot;morning&quot; &quot;day&quot; &quot;evening&quot; and &quot;night&quot; full of flickr images ready and waiting the be fetched randomly and plugged into automator&apos;s built-in &quot;set as desktop background&quot; step.  I can get &quot;day&quot; (or &quot;evening&quot; or whatever) to get entered into spotlight, but that doesn&apos;t do much good.&lt;br&gt;
&lt;br&gt;
(It would be even cooler if someone knew of a way to pull the photos straight from flickr, but that sounds hard.  I am, it should be obvious at this point, not a programmer at heart.)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.41273</guid>
	<pubDate>Fri, 30 Jun 2006 19:16:08 -0800</pubDate>
	<category>apple</category>
	<category>applescript</category>
	<category>automator</category>
	<category>mac</category>
	<category>macintosh</category>
	<category>osx</category>
	<category>programming</category>
	<category>scripting</category>
	<dc:creator>Tlogmer</dc:creator>
	</item>
	<item>
	<title>Where do these redundant Applescript dictionaries come from?</title>
	<link>http://ask.metafilter.com/40812/Where%2Ddo%2Dthese%2Dredundant%2DApplescript%2Ddictionaries%2Dcome%2Dfrom</link>	
	<description>When I use the &quot;Open Dictionary&quot; option in Apple&apos;s Script Editor (2.1.1, part of OS X 10.4.6), a lot of my apps have multiple dictionary entries.  Where do these come from?  How do I get rid of them? </description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.40812</guid>
	<pubDate>Fri, 23 Jun 2006 15:49:22 -0800</pubDate>
	<category>applescript</category>
	<dc:creator>mph</dc:creator>
	</item>
	<item>
	<title>AppleScript + Consulting = Profit?</title>
	<link>http://ask.metafilter.com/31290/AppleScript%2DConsulting%2DProfit</link>	
	<description>I was laid off recently and want to use my knowledge of AppleScript to do some consulting. I have a meeting this week about automating tasks for a local newspaper, but am uncertain how to bill such a project. How does one determine rates? Should it be by the hour or for the entire project? Is the source code typically given as well?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.31290</guid>
	<pubDate>Sun, 22 Jan 2006 15:46:59 -0800</pubDate>
	<category>applescript</category>
	<category>billing</category>
	<category>consulting</category>
	<category>work</category>
	<dc:creator>the biscuit man</dc:creator>
	</item>
	<item>
	<title>Applescript worth it?</title>
	<link>http://ask.metafilter.com/30213/Applescript%2Dworth%2Dit</link>	
	<description>Learning applescript, worth it? I switched from windows to a mac about a year ago on a whim, almost an experiment. Long story short, I&apos;m never going back. Now that I know I&apos;ll be staying on the mac platform, I&apos;m curious about applescript. Is it worth learning? Is it more a hobby or done for fun or can it really make the experience better. And even if it does add to the mac experience, would I just be better off using canned scripts? Does automator make applescript obsolete (I&apos;m still on panther)?&lt;br&gt;
&lt;br&gt;
Basically, worth taking the time to learn?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.30213</guid>
	<pubDate>Thu, 05 Jan 2006 00:32:09 -0800</pubDate>
	<category>apple</category>
	<category>applescript</category>
	<category>mac</category>
	<dc:creator>gtr</dc:creator>
	</item>
	<item>
	<title>How do I tell iTunes to search my Library for something?</title>
	<link>http://ask.metafilter.com/28723/How%2Ddo%2DI%2Dtell%2DiTunes%2Dto%2Dsearch%2Dmy%2DLibrary%2Dfor%2Dsomething</link>	
	<description>AppleScript: How do I tell iTunes to search my Library for something? I&apos;m finding AppleScript rather difficult which is weird because I know a lot of programming languages.  This just has some funky syntax.&lt;br&gt;
&lt;br&gt;
Anyway.  I&apos;ve tried:&lt;br&gt;
&lt;br&gt;
tell application &quot;iTunes&quot; to search library for &quot;search string&quot;&lt;br&gt;
&lt;br&gt;
and various alternatives.  But the library doesn&apos;t understand my search.  I would like to have a script that enters a particular search in the search bar of the main library window, and start playing the first track or some random track (if shuffle is selected), ultimatly.&lt;br&gt;
&lt;br&gt;
Thanks for any help!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2005:site.28723</guid>
	<pubDate>Thu, 08 Dec 2005 22:06:50 -0800</pubDate>
	<category>applescript</category>
	<category>itunes</category>
	<category>mac</category>
	<dc:creator>nickerbocker</dc:creator>
	</item>
	
	</channel>
</rss>

