Just a few scripts that I've put together over the past year or so. These are done in my spare time for my own use and are therefore completely unsupported. I hope you find them useful! (If you do find them particularly useful, you can thank me by sending me a picture of your hometown.)
All scripts are copyright ©2006-2007 by Ian Crew. You are free to use or modify any part of these scripts, so long as you give me credit and link to this website (http://ian.aramisdesign.com/software). All scripts are provided with no warranties, expressed or implied. Use at your own risk.
Update, 11/20/07: Unfortunately, Roxio has not resolved this issue with the new Toast 8.0.3/Toast Video Player 1.0.2 release.
The problem: The "Toast Video Player 1.0" app included with Roxio's Toast Titanium 8 has a bug in it which prevents the jump forward/jump backward and fast forward/rewind features from working properly. See the Roxio forums for a discussion of this problem.
The solution: A small AppleScript Studio (XCode) app that uses Apple's GUI Scripting (Enable Access for Assistive Devices in the Universal Access preference pane in System Preferences must be checked for this app to work) and Extra Suites 1.1 to precisely click on the progress bar in the Toast Video Player remote control, which is the only reliable way to advance or reverse through a video in that app.
There are some limitations to this solution:
Download here (28K Zip-compressed AppleScript Studio application)
(Last updated 11/15/2007)
The problem: I had web pages hosted on a server that did not support Apache's <!--#echo var="LAST_MODIFIED"--> syntax or IIS's <!--#FLASTMOD FILE="INDEX.html"--> syntax to include the date that a given file was last modified.
The solution: An AppleScript droplet that uses BBEdit's "replace" command to insert the file's modified date between two comment tags of the form <!--MODDATE--> <!--/MODDATE-->.
Download here (28K Zip-compressed AppleScript droplet)
(Last updated 11/10/2007)
The problem: My wife wanted to be able to play video podcasts on her Sony Ericsson phone, which couldn't handle the resolution of most podcast videos.
The solution: A script that talks to iTunes to get the list of video podcasts, uses VisualHub's Automation Tech Preview to convert the videos, and then adds them back into iTunes.
This script also serves as good sample code for reliably converting a large batch of files with VisualHub's Automation Tech Preview.
Download here (20K Zip-compressed AppleScript script)
(Last updated 11/10/2007)
The problem: If you're watching a video in Apple's QuickTime Player, there's no way to bookmark your current location in the video you're watching and come back to it later.
The solution: An AppleScript script that first checks if there's a "qtbookmark.txt" file in the user's "Movies" folder. If there is, it opens the movie specified in that file and starts playing it in full screen mode at the time specified. If there is not, it saves the path to and current time of the currently playing movie into the "qtbookmark.txt" file and quits the QuickTime Player. (This does have a limitation of only being able to bookmark one movie at a time, which is sufficient for my uses. Extending it to work with multiple bookmarks wouldn't be hard and is left as an excersise for the reader.)
This script is most useful if you place it in the /Library/Scripts folder and use the /Applications/AppleScript/AppleScript Utility application to turn on the Script Menu in the menu bar.
Download here (8K Zip-compressed AppleScript script)
(Last updated 10/16/2007)
The problem: The disk on my computer was getting quite full, so I wanted to see what the largest files on the disk were. (This really helped--the first time I ran it, I found a runaway log file that was over 10GB.)
The solution: An AppleScript script that's a much more user-friendly wrapper for the Mac OS X UNIX "find" command. When you run this script, you will be prompted for a folder to put aliases of the large files into as well as the minimum size of the files to search for. The script will then use "find" to create a list of the large files and alias them into that folder.
Download here (12K Zip-compressed AppleScript script)
(Last updated 5/20/2007)
The problem: My wife and I were looking at locations to move to in the San Francisco Bay Area, and we wanted to figure out how bad our commutes would tend to be.
The solution: An AppleScript that opens a Google Map centered on the Bay Area with the traffic information layer turned on. It then takes a screenshot and saves it in the "Traffic" folder on the desktop, with the date and time as part of the file name. Finally, it opens the screenshot in Graphic Converter and crops it so just the map is visible.
We set this script to run every 15 minutes from 7-9am and 4-6pm on weekdays using the following cron command:
0,15,30,45 7,8,16,17 * * 1-5 /usr/bin/osascript /Users/ian/Desktop/Traffic/GetTrafficMap.scpt
We left it to run for 4 weeks. After we had 20 days worth of data, we used Photoshop to take all the shots from each time of day (e.g. 7:45am), and combine them into a composite image (20 layers, each 5% transparency) to give an "average" view of traffic at that time of day.
Download here (8K Zip-compressed AppleScript script) The composite images we created (March 2007 in the SF Bay Area) are also available (10.7MB Zip Archive).
(Last updated 3/15/2007)
The problem: Whenever I was giving presentations, the display or the machine would go to sleep on me, causing the projector to go blank. It was a pain to change the Energy Saver settings to prevent this. Even if I did remember, I often forgot to change them back to a more normal mode.
The solution: An AppleScript to wrap the UNIX "pmset" command and provide a convenient toggle between Presentation and Normal settings.
If we're giving a presentation (on power or on battery), this script sets the display and the machine to never go to sleep, but allows the disk to shut down after 10 minutes of activity and run the internal screen at a lower brightness level when we're on battery.
If we're in normal mode and running on battery, this script sets the display ot run at a lower brightness and to shut itself off after 1 minute of inactivity. The disk is shut off after 2 minutes of inactivity, and the whole machine goes to sleep after 5 minutes of inactivity.
If we're in normal mode and running off of power, the script sets the display to itself off after 15 minutes of inactivity, and the disk to shut off after 10 minutes of inactivity. The system will never put itself to sleep.
All of these settings/timings are adjustable fairly easily by modifying the script.
This script is most useful if you place it in the /Library/Scripts folder and use the /Applications/AppleScript/AppleScript Utility application to turn on the Script Menu in the menu bar.
Download here (4K Zip-compressed AppleScript script)
(Last updated 12/5/2006)