Applescript 如何在apple脚本(脚本编辑器)中为重复操作添加简单计数器

Applescript 如何在apple脚本(脚本编辑器)中为重复操作添加简单计数器,applescript,Applescript,基本上,我有一个脚本,我在我的mac上运行使用脚本编辑器,以防止我的角色因为AFK而被踢。这是我现在拥有的 delay 5 repeat 10000 times tell application "System Events" key down "w" delay (random number from 0.5 to 1) key up "w" key down "s" delay (random num

基本上,我有一个脚本,我在我的mac上运行使用脚本编辑器,以防止我的角色因为AFK而被踢。这是我现在拥有的

delay 5
repeat 10000 times
    tell application "System Events"

        key down "w"
        delay (random number from 0.5 to 1)
        key up "w"

        key down "s"
        delay (random number from 0.5 to 1)
        key up "s"
        delay (random number from 20 to 30)
    end tell
end repeat
基本上,我只想添加一个计数器,这样我就可以看到它已经运行了多长时间。理想情况下,它将显示经过的总时间,而不是脚本被重复的次数,但两者都可以工作