Skip to content

Instantly share code, notes, and snippets.

@philchristensen
Created October 29, 2010 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philchristensen/653920 to your computer and use it in GitHub Desktop.
Save philchristensen/653920 to your computer and use it in GitHub Desktop.
a script to set your iChat message to the output from fortune
#!/usr/bin/perl
use strict;
use warnings;
my $fortune = `/sw/bin/fortune -s`;
$fortune =~ s/"/\\"/g;
open(OSASCRIPT, "| /usr/bin/osascript");
print OSASCRIPT <<EOF;
tell application "iChat"
set status message to "$fortune"
end tell
EOF
close(OSASCRIPT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment