The Pennyworth Project

Just another WordPress site

New AppleScript features coming in 1.0b5

It took me long enough, but I’m happy to report that the next version of my context sensing toolkit will include some new functionality provided via AppleScript.

First of all, you can query the system for current predictions and observations:

tell application "Pennyworth"
  value of prediction named "Location"
end tell

might return something like Home. Likewise,

tell application "Pennyworth"
  value of observation named "Desktop Observer (Running)"
end tell

might return something like Safari.

Secondly, if you use other apps that call AppleScripts in response to events, you can now instruct the system to log the observation using

tell application "Pennyworth"
  log "My Observation" from observer "My Custom Observer" with duration 10
end tell

This is equivalent to an internal observer logging observations. The “from observer” and “with duration” parameters are optional. The system will choose reasonable defaults if left empty.

This functionality has been requested from a few users, so I’m glad that it is now working. If you have any comments or questions, please post them in the comments below.

Posted by admin at 4:43 pm on February 19, 2008 . Filed under Other Apps,Pennyworth.

1 Comment

  1. Is that duration in seconds?

    Have you limited the number of seconds that can be specificed? I’m hoping not – I can think of some that would have VERY long timeouts (eg I’d like one that tells me if it’s light or dark outside, which could theoretically be months long if you lived above the artic circle but realistically would need about 18 hours at the lattitude I live at). And the longer the timeout the less push we have to put on the machine to calculate stuff 🙂


    Comment by Ricky Buchanan — February 20, 2008 @ 10:28 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.