TagUI icon indicating copy to clipboard operation
TagUI copied to clipboard

SyntaxError: Expected token ')' - can't replicate the issue pending clarification

Open KennGuo opened this issue 9 months ago • 4 comments

//点击写信 click //*[@id="ext-gen27"]

row = 3 max_row = 500

while row <= max_row // echo 正在处理第 row 行…

// 获取G列的值
run python get_g_value.py `row` to g_value
wait 2
// 如果G列有值,先在浏览器中输入
if `py_result` != ''
    // 定位到收件人框
    click //*[@id="ext-gen159"]
    type //*[@id="ext-gen159"] as [clear] `py_result`
    
    run python copy_range.py `row`
    wait 1
    
    // 定位到正文区域
    type //*[@id="ext-gen384"] as [clear]
    click //*[@id="ext-gen384"]
    keyboard [ctrl]v
    wait 100

// 处理下一行
row = row + 4

Hey~上面是我的代码,它总是因为下面的错误而退出 ` D:\MoreApps\tagui\flows\Email>tagui emailUser.tag SyntaxError: Expected token ')'

phantomjs://code/emailUser.tag.js:2113 in injectJs phantomjs://code/bootstrap.js:456 ` 我检查了bootstrap.js:456,代码如下:

Image 我实在找不到问题出在哪,当我把keyboard [ctrl]v删除后就正常了。 但是由于脚本逻辑,keyboard [ctrl]v是必须的,因为它包含excel的表格格式。请帮我看看哪里出了问题

KennGuo avatar Jul 09 '25 09:07 KennGuo

Image 这是JS文件报错部分

KennGuo avatar Jul 10 '25 05:07 KennGuo

虽然不知道怎么做,但是可以请教怎么实现鼠标下滑吗?

lemontree888 avatar Sep 11 '25 02:09 lemontree888

Hi @KennGuo I tried running below code but it does not give error. Can you also show the whole script other then below code to see what else could be the issue?

row = 1

// 获取G列的值
run python get_g_value.py `row` to g_value
wait 2
// 如果G列有值,先在浏览器中输入
if `py_result` != ''
    // 定位到收件人框
    click //*[@id="ext-gen159"]
    type //*[@id="ext-gen159"] as [clear] `py_result`

    run python copy_range.py `row`
    wait 1

    // 定位到正文区域
    type //*[@id="ext-gen384"] as [clear]
    click //*[@id="ext-gen384"]
    keyboard [ctrl]v
    wait 100

// 处理下一行
row = row + 4

For me, it tries to run without the error you have

RPA:src kensoh$ tagui t.tag -n

START - automation started - Thu Sep 11 2025 11:21:17 GMT+0100 (BST)
run python get_g_value.py '+row+' to g_value
wait 2
click //*[@id="ext-gen159"]

My TagUI version

RPA:src kensoh$ ./tagui
tagui v6.46: use following options and this syntax to run - ./tagui flow_filename option(s)

kensoh avatar Sep 11 '25 10:09 kensoh

Hi @lemontree888 I think you can use the hover step. Can you share more on your scenario?

https://tagui.readthedocs.io/en/latest/reference.html#hover

kensoh avatar Sep 11 '25 10:09 kensoh