PDA

View Full Version : Writing extensions for Alfred?




lynkynpark86
Apr 8, 2012, 07:10 PM
Anyone who has used and written extensions for alfred, can you tell me if this is possible:
I want to write an applescript to take the input, do it's process, and spit it out in the first result box. To understand what I mean, type "2+2" into alfred. I want to put the output where alfred puts "4", and also have the "copy to clipboard" function of Calculator. Can this be done?



seepel
Apr 11, 2012, 10:15 PM
a friend of mine wrote a great utility for this type of thing. it's called CalcuBar and it available in the app store. it handles basic to not soba sic functions and can even save macros. I use it regularly and for $0.99 I think it is definitely worth the price of admission.

lynkynpark86
Apr 14, 2012, 07:52 PM
a friend of mine wrote a great utility for this type of thing. it's called CalcuBar and it available in the app store. it handles basic to not soba sic functions and can even save macros. I use it regularly and for $0.99 I think it is definitely worth the price of admission.

I appreciate the time you took to answer, but... Did you read the question?

seepel
Apr 15, 2012, 09:49 AM
Yes I did read the question, I assumed you were looking for a solution to the problem of "I want to quickly calculate things". So that is what I answered.

If you really want to do it yourself I'm afraid I can't give any insights on writing a plugin for Alfred as I'm unfamiliar. But as for as the math end, You'll probably want to look into tokenizing and likely NSScanner. Once you've tokenized the sting you can map operators (like "+") to the operations they represent.

balamw
Apr 15, 2012, 09:59 AM
You might want to check with OP of this thread: http://forums.macrumors.com/showthread.php?t=1287247

B