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

Display system uptime in a Finder dialog System
I was thinking that there must be an easier way than going to Terminal and typing uptime in order to find out how long my machine had been up. So I wrote a wee AppleScript that gives the answer in the form of a Finder dialog window. Stick this into Script Editor, and save it as Application (or Application Bundle).
set output to do shell script "uptime"

tell application "Finder"
    display dialog output buttons {"OK"} default button 1
end tell
If you wish, you can then add a shortcut to it from your launcher. Voila, uptime and load averages at your findertips (literally).

[robg adds: This is a very simple hint, but one that demonstrates to new AppleScript users how to display the output from any Terminal command in a dialog. For uptime, and many other Terminal commands whose output I'd like to see on occasion (such as the results of the last Time Machine backup), I use GeekTool, as described in this Pick of the Week entry. (And yes, that feature will return in some form shortly...).]
    •    
  • Currently 1.60 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[15,006 views]  

Display system uptime in a Finder dialog | 7 comments | Create New Account
Click here to return to the 'Display system uptime in a Finder dialog' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
even simpler...
Authored by: wallybear on Mar 18, '08 08:00:23AM

in one single line:

tell application "Finder" to display dialog (do shell script "uptime") buttons {"OK"} default button 1




[ Reply to This | # ]
just in time
Authored by: alpayerturkmen on Mar 18, '08 08:48:29AM
I was bragging about my MBP's uptime on my blog just as I have read. Oh and also the Safari update will reset all the counters :P
http://www.unofficialmac.com/

[ Reply to This | # ]
Display system uptime in a Finder dialog
Authored by: StarvArt on Mar 18, '08 08:56:57AM
robg wrote:... as described in this Pick of the Week entry. (And yes, that feature will return in some form shortly...).]
Great news, Rob! I know you've been more than your usual way-too-busy, but I've really missed the PotW! (and other RobG contributions)!

[ Reply to This | # ]
Display system uptime in a Finder dialog
Authored by: andrew_zinn on Mar 18, '08 10:01:07AM

Somewhere along the way I downloaded this version of an Uptime applescript from Apple:

set this_data to do shell script "uptime"
set x to the offset of "up" in this_data
set this_data to (characters x thru -1 of this_data) as string
display dialog this_data buttons {"OK"} default button 1



[ Reply to This | # ]
Display system uptime in a Finder dialog
Authored by: gxw on Mar 18, '08 05:35:48PM

Thanks for the hint.
Modified to give me a fortune cookie upon login.
You'll need to install the fortune package from Darwin ports.

set output to do shell script "/opt/local/bin/fortune"

tell application "Finder"
display dialog output buttons {"OK"} default button 1 with title "Fortune Cookie"
end tell



[ Reply to This | # ]
Display system uptime in a Finder dialog
Authored by: robogobo on Mar 19, '08 05:08:07PM

or you can use the iStat pro widget from iSlayer.com. I used to be a big fan of Marcel Bresnik's utilities, but this free widget gives you all your system stats at a glance, if you use Dashboard.



[ Reply to This | # ]
Now you can do the same in Adium
Authored by: wesg on Mar 25, '08 09:49:40AM
I created an AdiumXtra to do this in a message.

http://adiumxtras.com/index.php?a=xtras&xtra_id=5333

Download the script and use /uptime to activate it.

I had a 15 day uptime going, then Safari was updated and now I'm back at 5. :(

---
2GHz Core 2 Duo MacBook
http://www.wesg.ca

[ Reply to This | # ]