Go Down

Topic: OS X: arduino + adium and gmail (Read 955 times) previous topic - next topic


Here's a processing sketch that polls adium using the applescript you gave earlier.
It returns an integer.
Nobody never talks to me, so I always get 0, but it should work ^^

Code: [Select]

import com.apple.cocoa.foundation.*;

void setup() {
 int adiumUnread = runAS();

void draw() {

public int runAS() {
 String script = "tell application \"Adium\"\n"
 +"  set x to 0\n"
 +"    repeat with theChat in (every chat)\n"
 +"    set x to x + (unread message count of theChat)\n"
 +"    end repeat\n"
 +"  end tell\n"
 +"  x";
 NSAppleScript myScript = new NSAppleScript(script);
 NSMutableDictionary errors = new NSMutableDictionary();
 NSAppleEventDescriptor result = myScript.execute(errors);
 return result.int32Value();


Feb 21, 2009, 08:29 pm Last Edit: Feb 21, 2009, 08:34 pm by formatc1702 Reason: 1

thanks for that. however, it says it can't find the package com.apple.cocoa

where can i find it, and how can i make processing see it? i am already using javax.mail and i just had to copy it to the /code folder inside my sketch folder.



Sorry, I forgot about that.
The package is already present on macosx systems, but a bit find to hard.
Here's the way to have it working



wonderful! it works perfectly! e-mail and adium notifications on the arduino!

thanks a lot for all the help... i'm slowly getting into processing after all! (and a bit of applescript on the way)


Go Up