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


Click here to return to the 'Use CalcService for easier image resizing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use CalcService for easier image resizing
Authored by: adrianm on Jan 05, '04 03:34:47PM
Panther has a built-in service which is; evaluate an applescript expression and replace it with result.

On my Mac, it is associated with Cmd+*

Now, 3*12 happens to be a valid expression, so type it into any Cocoa text field, select it, type Cmd+* and it is replaced with 36.

Of course, as it is evaluating an applescript expression, you can be quite inventive, eg length of "Hello" returns 5, random number returns (eg) 0.628961449436, etc.

Another use: get environment variables: system attribute "HOME" for me returns /Users/adrian.

Very handy and I use it all the time.

[ Reply to This | # ]

Use CalcService for easier image resizing
Authored by: semios on Jan 05, '04 06:55:44PM

Woah. That's pretty damn cool.

Services feel weird. I don't understand them yet, really. I feel the same way about them as I felt about pipes in DOS. They're there and they have some limited utility, but is that all they're there for? It wasn't until I saw them in unix that I really understood what good they were. Maybe if I saw Services in NeXT I'd understand.



[ Reply to This | # ]
Use CalcService for easier image resizing
Authored by: aranor on Jan 07, '04 04:38:58PM

How's yours associated with Cmd+*? It's not for me (I assume you mean Get result of applescript)



[ Reply to This | # ]
Use CalcService for easier image resizing
Authored by: NeutronMonk on Jan 08, '04 12:51:47PM

When I first tried the command+* keystroke with a simple calculation in TextEdit, it did nothing. By about the third try (I'm persistent!), the keystroke launched Script Editor, and the script completed. This apparently works only with Script Editor running in the background- at least in my case. In any event, really quite useful.



[ Reply to This | # ]