Note that there are some explanatory texts on larger screens.

plurals
  1. POApplescript: Unknown error
    primarykey
    data
    text
    <p>I have been working on a script for a while now, and have had many questions asked. I also rewrote a lot of the code as per some peoples suggestions. Yet, I still have this one question that has been unanswered. Below is the code for a "Siri" like iMessage PA. Basically, when I say commands through iMessage to it, it responds.</p> <p>I have been trying desperately to make it have a bit more intelligence by having it reply in sentences. You can see in the code, when it asks me "...are you ok?" It <em>should</em> look for either "yes" or "no", but only when the first question as been asked. Yet currently it just reponds with the initial "I am fine sir, are you ok?" and then does nothing after that when I tell it yes or no.</p> <p>Just to be sure its not the main code I have added a plain "hello world" to see if will respond normally which it does. Below is the code:</p> <pre><code>using terms from application "Messages" on message received theMessage from theBuddy for theChat if theMessage is "hello" then helloresponse() end if if theMessage contains "Are you ok" then areyouok() if theMessage is "yes" then happyResponse() else if theMessage is "no" then unhappyResponse() end if end if end if if theMessage contains "hello world" then helloworldresponse() end if end message received end using terms from on helloresponse() tell application "Messages" send "Hey sir!" to buddy "email@1.com" of service "E:email@2.com" end tell end helloresponse on happyResponse() tell application "Messages" send "you said yes, yey!" to buddy "email@1.com" of service "E:email@2.com" end tell end happyResponse on unhappyResponce() tell application "Messages" send "You said no, thats a shame!" to buddy "email@1.com" of service "E:email@2.com" end tell end unhappyResponce on areyouok() tell application "Messages" send "I am fine sir, are you ok?" to buddy "email@1.com" of service "E:email@2.com" end tell end areyouok on helloworldresponse() tell application "Messages" send "World replies: Hello." to buddy "email@1.com" of service "E:email@2.com" end tell end helloworldresponse </code></pre> <p>Thanks for any help people can give me!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload