过去文本框中的变量

时间:2017-09-25 21:06:33

标签: javascript text numbers web applescript

我不知道该怎么做。我在论坛和外面做了很多事情,但我无法解决。 我想把“IVA”变量中的te文本放到网站上的文本框中。 我搜索文本框的id是:f1:j_idt144

这是代码的最后一部分:

   tell application "Numbers"
    activate
    set a to "A"
    set b to "B"
    set c to "C"
    set d to "D"
    set e to "E"
    set f to "F"
    set y to "1"
    repeat 5 times
        tell application "Numbers"
            activate
            tell table 1 of sheet 1 of document 1
                --display dialog a & y
                set y to y + 1
                set az to a & y
                set bz to b & y
                set dz to d & y
                set ez to e & y
                set fz to f & y
                set the selection range to cell az
                copy value of cell az to IVA
                copy value of cell dz to CF
                copy value of cell ez to import
                copy value of cell fz to intestatario
                copy value of cell bz to giorno
                display dialog IVA & " , " & CF & " , " & import & " , " & intestatario & " , " & giorno
                delay 1
            end tell
        end tell
        tell application "Safari"
            activate
            do JavaScript "document.getElementsById('f1:j_idt144')[0].click();" in document 1
            delay 1
            tell the application "System Events" to keystroke IVA
            delay 2
        end tell

    end repeat
    -- attivare
    display notification "FINISHED" sound name "Glass" with title "#Tag Liker"
end tell

1 个答案:

答案 0 :(得分:0)

试试这个

tell application "Safari"
    activate
    set javascriptString to "document.getElementsById('f1:j_idt144')[0].value='" & IVA & "';"
    do JavaScript javascriptString in document 1
    delay 1
    tell the application "System Events" to keystroke IVA
    delay 2
end tell
相关问题