Error in executeScript code: E353: csPostMessage: timeout 5000 ms

This issue is solved in V9.0.5 :slight_smile:

Now executeScript waits at least 5 seconds or the !timeout_wait value (if > 5).

Test macro:

{
  "Name": "api1",
  "CreationDate": "2024-2-19",
  "Commands": [
    {
      "Command": "echo",
      "Target": "runtime=${!runtime}",
      "Value": "brown",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "15",
      "Value": "!timeout_wait",
      "Description": "New feature:  executeScript  waits until !timeout_wait (here: 15s), but at least 5s."
    },
    {
      "Command": "executeScript",
      "Target": "var start = new Date().getTime();\nvar delay = 12000; \nwhile (new Date().getTime() < start + delay) {\n    \n}\nreturn 3; \n",
      "Value": "a",
      "Description": "This script takes 12 seconds to run"
    },
    {
      "Command": "echo",
      "Target": "runtime=${!runtime}, return value=${a}",
      "Value": "blue",
      "Description": ""
    }
  ]
}
2 Likes