This commit is contained in:
2026-02-18 11:12:31 +01:00
parent 8044e92efd
commit b0a7917ecc
3 changed files with 19 additions and 7 deletions

View File

@@ -899,7 +899,14 @@
;; get value of an element
(def-cmd ww-get-value
value ((win-id ww-win?)
(element-id symbol-or-string?)) () -> json)
(element-id symbol-or-string?)) () -> string
=> (λ (val)
; expect <element-id>:{ "result": <result: string> }
(let ((e-id (format "~a:" element-id)))
(unless (string=? (substring val 0 (string-length e-id)) e-id)
(error "Unexpected for ww-get-value, result does not start with requested id"))
(ww-from-json (substring val (string-length e-id)))))
)
;; set value of an element
(def-cmd ww-set-value