Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > The hidden calculator in OS X

The hidden calculator in OS X
Thread Tools
Forum Regular
Join Date: Dec 2005
Location: Orlando, FL
Status: Offline
Reply With Quote
Aug 24, 2006, 10:44 AM
 
Its been a few years since I switched to macs and every now and then I would learn about some cool feature of OS X that would just blow me away. Today I found out about the hidden calculator (AppleScript). Very often I'll be typing an email or surfing the web and I'll want to do some simple math like say "3.1415 * 3.5 ^ 2" but to do this I'll have to open the Calculator application make a few clicks to input the numbers and its a big pain. I would rather use a real calculator, but I just found out in Tiger all you need to do is type in some expression "3.1415 * 3.5 ^ 2" or even "pi * 3.5 ^ 2" select it and press command + shift + 8 and you have the result replacing your selection. That is just amazing. This works in Mail, Safari, TextEdit and almost all the applications that I have tried. It seems to work even in 10.3. I'm sure most of you guys must be aware of it but there would be others (like me) who would find this helpful. I thought I'll share.
     
Professional Poster
Join Date: Dec 2000
Location: Staffs, UK
Status: Offline
Reply With Quote
Aug 24, 2006, 10:53 AM
 
Haha - that is cool. Thanks for sharing.

2 + 2 = 4
     
Mac Elite
Join Date: Mar 2001
Location: Madison, WI
Status: Offline
Reply With Quote
Aug 24, 2006, 11:12 AM
 
Doesn't work for me in Mail...beachballs and I have to force quit
I do not like those green links and spam.
I do not like them, Sam I am.
     
hemant  (op)
Forum Regular
Join Date: Dec 2005
Location: Orlando, FL
Status: Offline
Reply With Quote
Aug 24, 2006, 11:26 AM
 
Check your Mail Preferences (Composing), if your mail format is "Rich Text" it might not work, should work with "Plain Text" though. But I don't see why you should get the beach ball.
     
Mac Elite
Join Date: Nov 2001
Location: Dark Side of the Moon
Status: Offline
Reply With Quote
Aug 24, 2006, 11:37 AM
 
That is very cool, a pity the apple script has to launch too, but still cool. I wonder if they could integrate it nicely in Leopard, ala the dictionary window that pops up.
     
Addicted to MacNN
Join Date: Oct 2002
Location: England | San Francisco
Status: Offline
Reply With Quote
Aug 24, 2006, 12:57 PM
 
doesn't work for me :/
we don't have time to stop for gas
     
Mac Elite
Join Date: Mar 2001
Location: Madison, WI
Status: Offline
Reply With Quote
Aug 24, 2006, 01:14 PM
 
Originally Posted by hemant
Check your Mail Preferences (Composing), if your mail format is "Rich Text" it might not work, should work with "Plain Text" though. But I don't see why you should get the beach ball.
No. I'm using plain text. It works in TextEdit, TextWrangler, Camino, and others. Could be due to the other Applescripts I have in Mail.
I do not like those green links and spam.
I do not like them, Sam I am.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Aug 24, 2006, 01:19 PM
 
Hey, that's great! Thanks a lot for that tip. I think I'll be making a lot of use of this. It works in every app that supports Services, which includes all Cocoa apps.

Unfortunately, Word is not one of those apps. I hope those rumors of iWork getting a spreadsheet and a proper font menu are true - I may consider switching if that happens.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Professional Poster
Join Date: Jun 2006
Location: "Working"
Status: Offline
Reply With Quote
Aug 24, 2006, 01:27 PM
 
That's pretty cool...I actually converted the expressions you guys wrote directly in Safari...so 2 + 2 = 4 became 4 = 4 in my browser window.
     
Mac Elite
Join Date: Aug 2004
Location: Seattle, WA
Status: Offline
Reply With Quote
Aug 24, 2006, 01:28 PM
 
Doesn't work for me either. I think this is because they way it's being run (through the script service) and because Apple + * (or apple shift 8) is listed as "Get result of Applescript", and script editor may think you mean different scripts. When I do it, it pastes whatever is on the clipboard into the text box.

Someone correct me if I'm wrong, but I'm guessing the calculator trick works if you've never used script editor before.

ImpulseResponse
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 24, 2006, 01:30 PM
 
Doesn't work for me. Odd.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
JKT
Professional Poster
Join Date: Jan 2002
Location: London, UK
Status: Offline
Reply With Quote
Aug 24, 2006, 03:27 PM
 
Get CalcService (free) which lets you do even more. From the same developer as WordServices.
     
Dedicated MacNNer
Join Date: Oct 2002
Status: Offline
Reply With Quote
Aug 24, 2006, 05:47 PM
 
yeah wow, this totally screws up my mail.. none of the commands really work anymore.

how totally annoying.

so fyi, before you try this get ready to totally fuxor your machine.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Aug 24, 2006, 05:54 PM
 
What do you mean by "none of the commands"?

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Posting Junkie
Join Date: May 2001
Location: Brisbane, Australia
Status: Offline
Reply With Quote
Aug 24, 2006, 06:52 PM
 
2 + 2

Nope. Doesn't work for me at all. Weird.

[ fb ] [ flickr ] [] [scl] [ last ] [ plaxo ]
     
Professional Poster
Join Date: Jan 2001
Location: Australia, the greatest country in the world, (Australians keep telling me).
Status: Offline
Reply With Quote
Aug 24, 2006, 07:17 PM
 
works for me, launches script editor in the background.
     
Mac Elite
Join Date: Aug 2002
Location: Safe House
Status: Offline
Reply With Quote
Aug 24, 2006, 07:32 PM
 
Only works in TextEdit for me
     
Addicted to MacNN
Join Date: Jul 2001
Location: Behind the dryer, looking for a matching sock
Status: Offline
Reply With Quote
Aug 24, 2006, 09:28 PM
 
Originally Posted by - - e r i k - -
4

Nope. Doesn't work for me at all. Weird.
Works in mine, apparently.

     
Dedicated MacNNer
Join Date: Oct 2003
Location: Saint Louis, MO
Status: Offline
Reply With Quote
Aug 24, 2006, 10:22 PM
 
Works for me in Safari's Google search.
Mac OS X vs. Windows Vista
http://www.macvswindows.com/
     
Posting Junkie
Join Date: May 2001
Location: Brisbane, Australia
Status: Offline
Reply With Quote
Aug 24, 2006, 10:31 PM
 
Originally Posted by xi_hyperon
Works in mine, apparently.

Thanks, I'll be sure to call on you for all my math problems from now on

[ fb ] [ flickr ] [] [scl] [ last ] [ plaxo ]
     
Forum Regular
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 25, 2006, 01:03 AM
 
Doesn't work for me...

A while back, about 8 months ago, it would not work. A few weird things happened other than this, and I decided to reinstall the OS from scratch. This was one of the first things that I tested, and it finally worked. Now, it no longer works again.

It's quite annoying. I'd love to know why it works, but then simply stops working for no obvious reason. Deleting preference files for Script Editor does nothing.

Anyone have any idea why it would stop working?
Dennis R. Metzcher
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
     
Forum Regular
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 25, 2006, 01:17 AM
 
Whatever the problem is, it's with my account, because this works in another account that I have set up on my machine. Weird.
Dennis R. Metzcher
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
     
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status: Offline
Reply With Quote
Aug 25, 2006, 03:07 AM
 
Works, if I use the correct shortcut for my keyboard, which is cmd-shift-' , or cmd-* (same thing).
     
JKT
Professional Poster
Join Date: Jan 2002
Location: London, UK
Status: Offline
Reply With Quote
Aug 25, 2006, 03:28 AM
 
Originally Posted by dmetzcher
Whatever the problem is, it's with my account, because this works in another account that I have set up on my machine. Weird.
You probably installed something with a conflicting keyboard shortcut.
     
Forum Regular
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 25, 2006, 10:53 AM
 
Originally Posted by JKT
You probably installed something with a conflicting keyboard shortcut.
It's not the shortcut. It see the TextEdit menu light up briefly when I press the keys, so I know there is no conflict. Also, I tested it by clicking the menu item itself. The problem we (many of us) are having is not a shortcut issue, it's a problem with this service not working at all, regardless of which of the three menu items under Services -> Script Editor is used.

I've been looking for an answer to this problem for months now, and have never seen one posted anywhere on the Web. All the questions, on every board I've looked at, including Apple's, have gone unanswered. This feature is clearly problematic, at best, and seems to stop working for many people after several months, for whatever reason. It's just not reliable enough to be useful, frankly.
Dennis R. Metzcher
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
     
Grizzled Veteran
Join Date: Jul 2001
Location: Sydney, Australia
Status: Offline
Reply With Quote
Aug 25, 2006, 12:55 PM
 
Doesn't work for me either FWIW, the textedit menu flashes and that's it.

You can't eat all those hamburgers, you hear me you ridiculous man?
     
Mac Elite
Join Date: Aug 2001
Location: Capitol City
Status: Offline
Reply With Quote
Aug 25, 2006, 01:28 PM
 
works great for me in my chat text area and google box, and maybe even this...lets try a good one 10^(10/5) => 100.0 seems to work. Thats pretty spiff
     
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Aug 25, 2006, 01:40 PM
 
Spiffy.
     
JKT
Professional Poster
Join Date: Jan 2002
Location: London, UK
Status: Offline
Reply With Quote
Aug 25, 2006, 02:27 PM
 
Originally Posted by dmetzcher
It's not the shortcut. It see the TextEdit menu light up briefly when I press the keys, so I know there is no conflict. Also, I tested it by clicking the menu item itself. The problem we (many of us) are having is not a shortcut issue, it's a problem with this service not working at all, regardless of which of the three menu items under Services -> Script Editor is used.

I've been looking for an answer to this problem for months now, and have never seen one posted anywhere on the Web. All the questions, on every board I've looked at, including Apple's, have gone unanswered. This feature is clearly problematic, at best, and seems to stop working for many people after several months, for whatever reason. It's just not reliable enough to be useful, frankly.
Install CalcService instead and see if it works (link is toward the bottom of that page).


     
Professional Poster
Join Date: Dec 2002
Location: Partying down with the Ewoks, after I nuked the Death Star!
Status: Offline
Reply With Quote
Aug 25, 2006, 04:35 PM
 
I just use the damn dashboard one.

"Hello, what have we here?
     
Baninated
Join Date: Sep 2002
Location: http://www.rotharmy.com
Status: Offline
Reply With Quote
Aug 25, 2006, 04:52 PM
 
me too

the calculator app is buggy as ....
     
Dedicated MacNNer
Join Date: Oct 2003
Location: Saint Louis, MO
Status: Offline
Reply With Quote
Aug 25, 2006, 10:13 PM
 
Hmmm...it doesn't appear to work in Mail
Mac OS X vs. Windows Vista
http://www.macvswindows.com/
     
Forum Regular
Join Date: Dec 2000
Status: Offline
Reply With Quote
Aug 26, 2006, 01:09 PM
 
at first i thought it didn't work, all it did was paste what was on the clipboard...but you actually have to follow the directions. i wasn't highlighting the problem/expression.
BTW, it works with the stickies too. it just sucks that it launches applescript.
     
Forum Regular
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 26, 2006, 02:14 PM
 
Originally Posted by nuckin futs
at first i thought it didn't work, all it did was paste what was on the clipboard...but you actually have to follow the directions. i wasn't highlighting the problem/expression.
BTW, it works with the stickies too. it just sucks that it launches applescript.
Yeah, launching AppleScript is clunky. I understand doing it for the evaluation of an actual script, but there should be a calc service that evaluates expressions without resorting to AppleScript.
Dennis R. Metzcher
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
     
Forum Regular
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 26, 2006, 02:16 PM
 
Originally Posted by JKT
Install CalcService instead and see if it works (link is toward the bottom of that page).


Thanks! I've installed it. I'll test it in a few.
Dennis R. Metzcher
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Aug 26, 2006, 03:18 PM
 
If you don't have CalcServices installed, Command-Shift-8 (or, more specifically, Command-*) is assigned to the Script Editor -> Get Result of AppleScript service menu.

As a result you can select any text that's valid AppleScript and invoke it via Command-Shift-8.

For example, select the text:

beep 2

and Command-Shift-8 and you'll hear two beeps.
Gods don't kill people - people with Gods kill people.
     
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status: Offline
Reply With Quote
Aug 26, 2006, 03:49 PM
 
CMD-* with beep 2 doesn't work.

Calc Service: beep 2
Result: Syntax error


-t
     
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status: Offline
Reply With Quote
Aug 26, 2006, 05:06 PM
 
Originally Posted by what_the_heck
It appears you do have CalcServices installed and mapped to CMD-*.

The 'beep 2' thing was supposed to work with the default 'AppleScript' thing, not CalcServices.
     
Mac Elite
Join Date: Jan 2001
Location: Kansas City, Mo
Status: Offline
Reply With Quote
Aug 26, 2006, 09:33 PM
 
That is a nice trick. Works great in the Google search bar.
     
Mac Elite
Join Date: May 2003
Location: Somewhere
Status: Offline
Reply With Quote
Aug 26, 2006, 09:48 PM
 
How's doing this any easier or faster than the dashboard calculator. If I have to download and instal an app to do that then it's not all that cool. We all can't be that lazy that we need to find a shortcut to calculator functions.
iMac 24" 2.8 Ghz Core 2 Extreme
500GB HDD
4GB Ram
Proud new Owner!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 27, 2006, 12:04 AM
 
Originally Posted by hldan
How's doing this any easier or faster than the dashboard calculator.
It doesn't suck up a ton of memory and require you to wait 30 seconds for Dashboard to load. Just off the top of my head.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Posting Junkie
Join Date: Mar 2001
Location: Salamanca, España
Status: Offline
Reply With Quote
Aug 27, 2006, 12:25 AM
 
Originally Posted by kcmac
That is a nice trick. Works great in the Google search bar.
Yeah, just press enter and *bingo* instant answer

V
I could take Sean Connery in a fight... I could definitely take him.
     
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Aug 27, 2006, 11:45 PM
 
works with quicksilver's text entry too. Activate quicksilver, press "." and type. I love QS more and more each day.
     
cla
Mac Enthusiast
Join Date: Mar 2000
Status: Offline
Reply With Quote
Aug 29, 2006, 06:54 PM
 
This is so cool! Now we can paste scripts to each other, mark the script and hit cmd-*
Mark the bold text below, and hit cmd-*

tell application "Safari"
activate
set di to display dialog "Where do you want to go today?" default answer "http://www.microsoft.com"
open location text returned of di
end tell


(Although I get a 20 second stall when I do this...)
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Aug 30, 2006, 02:36 AM
 
Originally Posted by cla
(Although I get a 20 second stall when I do this...)
Me too. Strange Safari lag.
     
Mac Elite
Join Date: Sep 2001
Location: Chile
Status: Offline
Reply With Quote
Aug 30, 2006, 11:16 AM
 
has to do with the keyboard layout (at least for me that was the problem). Changing it to English did the trick.
Alternatively you can use the asterisk on whatever key that your layout has it, or use the one on the keypad to avoid changing layouts.
:: frankenstein / lcd-less TiBook / 1GHz / radeon 9000 64MB / 1GB RAM / w/ext. 250GB fw drive / noname usb bluetooth dongle / d-link usb 2.0 pcmcia card / X.5.8
:: unibody macbook pro / 2.4 Ghz C2D / 6GB RAM / dell 2407wfp - X.6.3
     
Grizzled Veteran
Join Date: Jan 2005
Location: New Zealand
Status: Offline
Reply With Quote
Aug 30, 2006, 11:36 AM
 
That's a cool feature. Thanks for mentioning it!
MBP 15" C2D 2.2GHz 4.0GB 500GB@5400
iPhone 4 32GB Black
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Aug 30, 2006, 12:52 PM
 
Originally Posted by cla
This is so cool! Now we can paste scripts to each other, mark the script and hit cmd-*
Mark the bold text below, and hit cmd-*

tell application "Safari"
activate
set di to display dialog "Where do you want to go today?" default answer "http://www.microsoft.com"
open location text returned of di
end tell


(Although I get a 20 second stall when I do this...)
We were always able to do that, though.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 30, 2006, 12:55 PM
 
Ah, I remember that exploit.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Posting Junkie
Join Date: Sep 2001
Status: Offline
Reply With Quote
Aug 30, 2006, 01:36 PM
 
Ah! Very cool. I never knew.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 12:10 AM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2