Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

FlyingSwine

macrumors newbie
Original poster
Jan 31, 2012
6
0
CA, USA
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!
 

FlyingSwine

macrumors newbie
Original poster
Jan 31, 2012
6
0
CA, USA
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


----------

ELIZA is that you?
B
No, this is DOCTOR
 

Jolly Jimmy

macrumors 65816
Dec 13, 2007
1,357
3
Well what are you waiting for! Get typing all those ifs.

Seems like you answered your own question.
 

FlyingSwine

macrumors newbie
Original poster
Jan 31, 2012
6
0
CA, USA
Well what are you waiting for! Get typing all those ifs.

Seems like you answered your own question.

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?
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.