Chrome 如何在applescript上向下滚动?

nwlls2ji  于 2023-05-20  发布在  Go
关注(0)|答案(1)|浏览(156)

我试图使一个跟随/取消跟随机器人Depop。这是我到目前为止得到的。

tell application "Safari"
    activate
end tell

set Username to display dialog "What is your Depop username?" default 
answer ""
set Username to text returned of the result

tell application "Safari"
    activate
    open location "https://www.depop.com/" & Username
    delay 5
end tell
tell application "System Events"
    tell process "Safari"
        click at {350, 305} -- {from left, from top}
        click at {350, 305} -- {from left, from top}
        click at {1038, 407} -- {from left, from top}
        click at {1038, 482} -- {from left, from top}
        delay 1
    end tell

end tell

我试着让它点击follow,然后在另一个脚本中按unfollow。我正在努力使它向下滚动以点击跟随/取消跟随。此外,如果任何人有任何想法,如何使它更有效率,那么请让我知道。

jfgube3f

jfgube3f1#

您当前在Safari中打开了此页面。所以和我沿着滚动

--- script: scroll Safari current webpage 
-- written: by KniazidisR, today

tell application "Safari" to activate

tell application "System Events"
    key down 63 -- holding Fn key
    -- move carette 40 times down (scroll down)
    repeat 40 times
        key code 125
        delay 0.2
    end repeat
    key up 63 -- release Fn key
end tell

-- NOTE:
-- to scroll up, use 126

相关问题