Performancing Metrics

Home Blog
ByteClub Dev Blog
Set Skype/Adium/iChat status via Spotlight+AppleScript
Written by Peter Bakhyryev   
Thursday, 07 May 2009 16:10

I'm now running 3 chat/voice apps on my Mac: Adium, iChat and Skype (don't ask). After getting tired of setting status to 'Away' or 'Back' in 3 different places by hand, I decided to call AppleScript to the rescue. Here is an AppleScript that sets Adium, Skype and iChat status to "Away" in one fell swoop:

tell application "Adium"
	go away
end tell

tell application "Skype"
	send command "SET USERSTATUS AWAY" script name "AppleScript status setter"
end tell

tell application "iChat"
	set status to away
end tell

Here is the reverse of that script, allowing you to set your status back to "Online":

tell application "Adium"
	go available
end tell

tell application "Skype"
	send command "SET USERSTATUS ONLINE" script name "AppleScript status setter"
end tell

tell application "iChat"
	set status to available
end tell

Using Script Editor on Mac, you can save each one of these scripts as an "Application". After that, you can either launch them via Spotlight or by double-clicking.

-- Peter Bakhyryev


UPDATE 7/6/09: "Busy" status
In the comments, Francesco asked about setting the status to "Busy". In both iChat and Adium, that would be same thing as setting the status to "Away" with a custom away message. In Skype, the closest thing to "Busy" is probably "Do Not Disturb". Here is the code to do that:
tell application "Adium"
	go away with message "Busy"
end tell

tell application "Skype"
	send command "SET USERSTATUS DND" script name "AppleScript status setter"
end tell

tell application "iChat"
	set status to away
	set status message to "Busy"
end tell
 
Script to add iPhone developers to a TweetDeck group
Written by Peter Bakhyryev   
Wednesday, 28 January 2009 15:01

Tim Haines came up with a great idea to collect Twitter usernames of iPhone developers with a simple form using Google Spreadsheets. If you are using TweetDeck and wanted to add all these followers into a group, beware of getting Repetitive Stress Injury accompanied by blindness: there are 460+ names on that list as of right now, good luck clicking that many times. How about a script instead? I hacked Tim's script that automatically follows these people on your behalf, to insert some rows into TweetDeck's SQLite file instead.

Before you launch it:

- Make sure to install sqlite3 ruby gem ("sudo gem install sqlite3-ruby") and google spreadsheet gem
- Open TweetDeck and create a group. If you have one already, that's fine. Remember it's name. Close TweetDeck
- Find out where TweetDeck keeps it's database file. On OS X, follow these instructions:
1. go to ~/Library/Preferences
2. Search for directory that starts with "TweetDeckFast."
3. Inside, you'll find another directory called "Local Store"
4. Check that directory for a file with a name that looks like "td_26_your twitter name.db"
5. Copy the full path to that file, including it's name (In my case, the file is called "/Users/peter/Library/Preferences/TweetDeckFast.F9107117265DB7542C1A806C8DB837742CE14C21.1/Local Store/td_26_byteclub.db")
- In the script, replace values with your own

Script itself

UPDATE: Forgot to mention that this script actually doesn't follow people, it only attempts to add them to your TweetDeck group. Before you run this script, make sure to follow developers either by manually entering them in Twitter or, if you are into doing things in bulk, running the script that's mentioned in the spreadsheet itself.

 
How to (almost) create your own iPhone OS framework
Written by Peter Bakhyryev   
Tuesday, 25 November 2008 03:52

As of iPhone SDK version 2.1, it doesn't seem to be possible to package your own code into an iPhone OS framework. Messing around with OS X 10.5 framework build options didn't yield any useful results for us. The closest we got is a static library built for each platform (iPhone OS and the Aspen simulator), bundled up into one file (using a command line tool called 'lipo') and a set of header files that you would reference in order to use the library.

Read more...
 
New site is here!
Written by Peter Bakhyryev   
Friday, 21 November 2008 21:37

Welcome to the new ByteClub Platform development site. We are running in a private beta mode right now, until everything is tested and polished. We'll be posting news about ByteClub developments in this blog, so check back every once in a while.

Enjoy!