明明有text属性,确报错

代码很简单,如下。却报错text找不到。
换作bounds(),id()也一样。
用悬浮窗的控件查看器是可以看到的。

 var h = textMatches(/\+\d{1,3}g/)
        .untilFind();
 toastLog("adding "+h.text());
09:29:27.263/E: TypeError: Cannot call property text in object com.stardust.automator.UiObject@138483; boundsInParent: Rect(0, 0 - 57, 25); boundsInScreen: Rect(714, 402 - 885, 477); packageName: com.eg.android.AlipayGphone; className: android.view.View; text: +69g; contentDescription: null; viewId: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; enabled: true; password: false; scrollable: false; [ACTION_ACCESSIBILITY_FOCUS, ACTION_NEXT_AT_MOVEMENT_GRANULARITY, ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, ACTION_NEXT_HTML_ELEMENT, ACTION_PREVIOUS_HTML_ELEMENT]. It is not a function, it is "undefined". (<test+3g>#3)
	at script(<test+3g>:3)
最后由 basking 编辑

log(h.text()); 改成下面的试试吧!

h.forEach((i) => {
    log(i.text());
});
最后由 Zhan 0 编辑
  • 2
    帖子
  • 881
    浏览

与 Auto.js 的连接断开,我们正在尝试重连,请耐心等待