Problem with combined agent actions


(Robert Powell) #1

I thought I was getting the hang of this. I’ve created prototypes, agents that do queries, and adornments that capture relevant notes. I’ve also had the agents change the colors of the notes based on the query. However, when I try to have it also add a badge, everything fell apart; it loses the color and the badge doesn’t show. With some trial and error I’ve been able to reassert one or the other, either the badge or the color, but not both. Sometimes the color turns orange, sometimes black, but I’ve never achieved aqua and fish badge. Am I entering something incorrectly? Here is the Action expression: $Color=“aqua” & $Badge=“fish”


(eastgate) #2

Yes; you’ve written your action incorrectly.

To perform several actions together, separate them with semicolons. Your action should be

$Color=“aqua”; $Badge=“fish”;

The “&” symbol is a logical operator; it returns true if both the object on its left and the object on its right are true. It’s not doing what you want.


(Robert Powell) #3

Ok, thank you very much! I used what I was watching in a video and I guess his goal was just a bit different.


(James Fallows) #4

Yup, I remember stumbling across a similar issue when learning the program as well. There may be some exception to the following rule of thumb, but overall it will steer you right:

  • The & and | and ! symbols, meaning, respectively, and, or, and not, mainly show up in queries;
  • The ; symbol, for concatenating statements, mainly shows up in actions

(Again, I may not be thinking through all the exceptions, but in most operations this division-of-labor applies.)