Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'The Unread needs the Finder running' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
The Unread needs the Finder running
Authored by: subatomicsatan on Apr 21, '04 06:09:48PM

i'm not sure what "the unread" is written in, but can you make a unix system call to, for example, 'ps ax' and grep that for "Mail"? it would be trivial to do in perl, but i'm not sure how you've implemented "the unread."

btw, i just installed it and am liking it so far! :)

james



[ Reply to This | # ]
The Unread needs the Finder running
Authored by: robg on Apr 21, '04 06:52:09PM
I'm not sure how to handle the error trapping, but it's pretty trivial to use the shell via AppleScript; this one liner will return the info on Mail if it's running. If it's not running, it throws a Type 1 error:

do shell script "ps ax | grep 'Mail.app/Contents' | grep -v grep | grep -v sh"
I'm sure there are more elegant ways of handling this; the two "grep -v" commands are used to eliminate the actual grep command, as well as the shell process that AppleScript launches. I know very little about AppleScript, but it should be trivial to trap on the error (Mail not running) or the successful return (Mail is running), all without launching the Finder.

-rob.

[ Reply to This | # ]
The Unread needs the Finder running
Authored by: PsiPhi on Apr 21, '04 06:52:38PM

Well, it uses a combination of AppleScript and Cocoa so I could use that fairly easily inside the AppleScript but I just got an email from somebody that told me the "(get name of every process)" call is passed on to System Events by the Finder so I can just bypass Finder and ask System Events. That should work fine. Thanks for the suggestion, though.

I actually have a new version that is almost ready to be released and I will put this fix in the AppleScripts so that should alleviate the grandparent's complaint.



[ Reply to This | # ]
The Unread needs the Finder running
Authored by: Sarek on Apr 21, '04 11:21:07PM

Sorry if this is offtopic. I love your suggestions and troubleshooting on this issue. I'ved learned about a great app, the author gets involved in the discussion and others are flocking with resolutions -- this is what it means to be a mac user in today's age. 10 years ago I think it was more user-interface driven and how you can "trick-out" your UI... now it's about the developer and users coming together to solve problems.

Again, sorry for being off topic. I love "The Unread" and never knew it existed. I love the fact everyone is coming together. I love the fact the author seems so open. This just blows me away guys -- thanks!!

---
-Sarek



[ Reply to This | # ]