December 17, 2011: 12:48 am: General, Privacy

I like to remind folks when moving their Apple laptop to public wifi that they need to remember to turn off the iLife application sharing such as iTunes and iPhoto. Then turn on their firewall.

So here is an AppleScript that will do just that. It is written and tested on OSX Lion with iLife 11. So you may have to play with it for your version if that is not what you are running.  Keep in mind it is a toggle script.  It will reverse the settings of iPhoto, iTunes sharing and the firewall. So it is assumed you share both with the firewall off when at home.

Also you need to ensure Enable access for assistive devices is checked under Universal Access in System Preference.

Just cut and paste the below script into the AppleScript editor.  Then save either as an application on your desktop you can double click. Or save as an AppleScript where an application like LaunchBar can use it as an action. ~/Library/Application Support/LaunchBar/Actions

(more…)

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
September 11, 2011: 12:16 am: Automation
Here is an audio sample. I just quickly recorded it on my phone. So quality isn’t as good as usual. Also her narration of the traffic status needs work.  I also just noticed she is getting day and month backwards.  I need to fix that in the parsing code.

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
September 10, 2011: 10:03 pm: Automation

I have been playing around making a Jarvis like home notifaction script.  One piece of that for fun is to read me the current Brandon Sanderson book project status report.  I made the below applescript to parse the information off his Web site and read it aloud to me. After all men don’t read (a Stormlight Archive reference so go get the book).  I am a huge fan of his Mistborn and Stormlight Archive series.  Oh yeah… He is also finishing the Wheel of Time too. ;-)

Warning that the below script could break at any time.  It has to parse out bits of html code.  Who knows how much that changes each time updates his status.  I won’t know till the next update.  You can see those bits in the AppleScript’s text item delimeters lines in the script.

*UPDATE 9-18-2011* I updated the script below to help avoid breaking when Brandon updates his progress area.  It relies way less on the html code matching.

 

on run {}

 

try

set theSource to (do shell script “curl ” & quoted form of (“http://www.brandonsanderson.com/”))

set AppleScript‘s text item delimiters to {“<h3>Current Projects</h3>”}

set theText to text item 2 of theSource

set AppleScript‘s text item delimiters to {“<h3>Search</h3>”}

set theText to text item 1 of theText

set AppleScript‘s text item delimiters to {“<div style=”float:left;  width:100%;”>”}

set tempProject1 to text item 2 of theText

set tempProject2 to text item 3 of theText

set tempProject3 to text item 4 of theText

 

set percentStartProj1 to offsetof “%” intempProject1

set percentProj1 to text (percentStartProj1 – 3) thru (percentStartProj1) of tempProject1

set AppleScript‘s text item delimiters to {“  <br/>”}

set projectProgress1 to text item 1 of tempProject1 & percentProj1

 

set percentStartProj2 to offsetof “%” intempProject2

set percentProj2 to text (percentStartProj2 – 3) thru (percentStartProj2) of tempProject2

set AppleScript‘s text item delimiters to {“  <br/>”}

set projectProgress2 to text item 1 of tempProject2 & percentProj2

 

set percentStartProj3 to offsetof “%” intempProject3

set percentProj3 to text (percentStartProj3 – 3) thru (percentStartProj3) of tempProject3

set AppleScript‘s text item delimiters to {“  <br/>”}

set projectProgress3 to text item 1 of tempProject3 & percentProj3

 

set AppleScript‘s text item delimiters to {“”}

 

say “Brandon Sanderson Project Status Report”

sayprojectProgress1

sayprojectProgress2

sayprojectProgress3

 

on error

say “Unable to obtain Brandon Sanderson project status information.”

return

 

end try

 

end run

 

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
February 12, 2011: 12:15 pm: General, Programming

Recently we were sent a password protected zip file at work. If you have ever tried to double click open a protected zip file you know that you will get an error not a password prompt.

If we ignore third party applications to open these files we are left with running the unzip command from terminal. You can use the option “-P password” where you replace the word password with actual password used to protect the file. An example command might look like:

unzip -P strong password ~/Desktop/secretzip.zip

This may have been good enough for me. But we have less technically inclined folks in our group who needed access to the provided files. So I made an Automator that everyone in the group could reuse for even future files. The Automator needed several features.

  1. Provide a GUI browser selection box to choose the protected zip file.
  2. Prompt for the password needed to unzip the file.
  3. Send the content to the user’s desktop regardless of whom ran it.

Here is how we build the Automator. The key components are the use of variables within Automator and a shell script object that takes the file and password as arguments that were provided by the user.

(more…)

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
October 14, 2010: 8:56 pm: General

So who says Mac hard drives don’t need to be defragmented for performance at least once in a while? This is my 1TB external raid I use for audio/video projects Note the big red region it has yet to defrag.

Externaldrive
TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare