news

Re: How do I do this on Win...

Jeffery Priddy
SubjectRe: How do I do this on Windows?
FromJeffery Priddy
Date04/24/2004 18:45 (04/24/2004 16:45)
Message-ID<c6e5k7$tq1$1@gargoyle.oit.duke.edu>
Client
Newsgroupscomp.sys.mac.advocacy
FollowsSandman
FollowupsSandman (1h & 50m) > Jeffery Priddy

In news:mr-065618.18545821042004@news.fu-berlin.de, Sandman <mr@sandman.net>wrote:

Sandman
If you go to my homepage (http://www.sandman.net) you'll see at the bottom right four lines of information (with four different icons).

These are my "status" lines, or whatever you want to call them. It's just a fun thing I recently picked together. It's in swedish, but I think you'll understand what they do.

The first line tells the user what I am doing right now. I manage this with a Apple script that prompts me with what I am doing (upon request, not all the time) and then uploads this to the page.

The second line is also a applescript set to execute every five minutes, that fetches information from iTunes about what I am listening to at the moment.

The third and fourth lines are statuses about my computers. Basically, they tell the visitor if my computers are idle or not, and whether I am logged in to them. This is managed by a perl script on both these computers to upload relevant information every second minute.

All of this was fairly easy to set up - the hard part was figuring out how long the computer has been idle (since the AppleScript 'plugin' that does this in OS9 doesn't exist in OSX).

But how would it be done in Windows, using track information from WMP for instance? Idle time? logged in status? "Doing right now" prompt thingie?

Let's see.

The current song thing: I'm not sure about WMP; I use Winamp. If I were rolling my own, I'd use tlist (like ps) to get Winamp's title bar text, which would include the current song. Just parse out the playlist number and the Winamp title. It wouldn't surprise me if there were little applets or plugins to export this info from Winmap or WMP, but I haven't looked.

Prompting yourself for what you're currently doing would be easy. It's not hard to ask Windows what task currently has focus, so you could automate a variation of that, naming the app you currently have forward.

As for logon status, I have a freebie from sysinternals called psloggedon which shows who's logged on locally and who's accessing files or pipes through the network. There are a lot of other ways to do this, but this is what I would use.

The idle time: Well, I had an elaborate scheme cooked up to do this, based on the Task Scheduler, and it's ability to start any task after x minutes of idle time (usefull, eh?). But then my curiosity got the best of me, and I peeked thru Google to see if I could find anything better. I found a COM object for use with WSH that returns idle time straight up, so all my machinations seemed overly complicated. I could describe it, if you were curious, but now I'd just use this add-on.

Finally, someone answered your question... :-)


Thread