Advertisement
ThePersoni

Key Spammer for Mac

Jun 8th, 2021
2,353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "System Events"
  2.    
  3.    
  4.     set texttosay to "Sample Text"
  5.     display dialog "Text to type:" default answer "text "
  6.     set texttosay to the text returned of the result
  7.    
  8.     display dialog "Delay in seconds:" default answer "Number"
  9.     set delaynum to the text returned of the result as integer
  10.    
  11.     display dialog "Repeat number of times:" default answer "Number"
  12.     set rptnum to the text returned of the result as integer
  13.    
  14.     set returnkeystroke to {"Yes", "No"}
  15.     set returnkeystrokechosen to choose from list returnkeystroke with prompt "Seperate each message with enter?:" default items {"Yes"}
  16.     returnkeystroke
  17.    
  18.    
  19.     repeat
  20.         delay 2
  21.        
  22.         repeat rptnum times
  23.             keystroke texttosay
  24.             delay delaynum
  25.            
  26.             if returnkeystrokechosen is equal to "Yes" then
  27.                 keystroke return
  28.             end if
  29.            
  30.            
  31.            
  32.         end repeat
  33.        
  34.         display dialog the "Do you want to stop?" buttons {"Continue Script", "Stop"} default button 1
  35.         if the button returned of the result is "Stop" then
  36.             exit repeat
  37.         end if
  38.     end repeat
  39. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement