HELP! {Applescript}

Discussion in 'Mac Apps and Mac App Store' started by FlyingSwine, Jan 31, 2012.

  1. FlyingSwine macrumors newbie

    Joined:
    Jan 31, 2012
    Location:
    CA, USA
    #1
    So I'm trying to make an application in Applescript that's kind of like Siri, except you type what you're going to say instead of speaking it, and the program responds to you with built-in voice (yes, I know how to get strings and have the computer talk :cool:). Instead of typing in every combination of words in existence, I want it to recognize keywords. Let's say the user says "I hate you, you stupid machine," it would pick up "hate," "you" and "stupid," and reply "Did I do something wrong?" If the user said "I hate stupid machines," then it would differ and say "That's a very strong opinion"

    Thanks in advance!
     
  2. Jolly Jimmy macrumors 65816

    Jolly Jimmy

    Joined:
    Dec 13, 2007
    #2
    This is way beyond what it's possible to do with AppleScript.
     
  3. FlyingSwine thread starter macrumors newbie

    Joined:
    Jan 31, 2012
    Location:
    CA, USA
    #3
    Not really, I just want it to recognize certain words. There's got to be a way to do this!
     
  4. Jolly Jimmy macrumors 65816

    Jolly Jimmy

    Joined:
    Dec 13, 2007
    #4
    Yes really. Seriously. Siri?
     
  5. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
  6. FlyingSwine thread starter macrumors newbie

    Joined:
    Jan 31, 2012
    Location:
    CA, USA
    #6
    There's gotta be a function such as:
    Code:
    display dialog "Text here" default answer ""
    
    set inPut to (text returned of result)
    if inPut contains "keyword" then
    do something
    else if inPut contains "keyword" then
    do something
    else if inPut contains "keyword" then
    do something
    else if inPut contains "keyword" then
    do something
    else if...
    --And so on and so on
    


    ----------

    No, this is DOCTOR
     
  7. Jolly Jimmy macrumors 65816

    Jolly Jimmy

    Joined:
    Dec 13, 2007
    #7
    Well what are you waiting for! Get typing all those ifs.

    Seems like you answered your own question.
     
  8. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
  9. FlyingSwine, Jan 31, 2012
    Last edited: Jan 31, 2012

    FlyingSwine thread starter macrumors newbie

    Joined:
    Jan 31, 2012
    Location:
    CA, USA
    #9
    But the "contains" function doesn't exist -_-


    EDIT
    Turns out, the contains function DOES Exist! Heh, I'm embarrassed...
    While we're at it, would anyone know how to automatically save variables to a text file or something, and then read and load them the next time the program is opened?
     

Share This Page