Writing extensions for Alfred?

Discussion in 'Mac Programming' started by lynkynpark86, Apr 8, 2012.

  1. macrumors 6502

    #1
    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?
     
  2. macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #2
    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.
     
  3. thread starter macrumors 6502

    #3
    I appreciate the time you took to answer, but... Did you read the question?
     
  4. macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #4
    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.
     
  5. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England

Share This Page