Applescript user input
Hi, i can't understand why my script don't work. It works ok if i
manually insert the theRep times and the product theWeight.
set theRep to text returned of (display dialog "How many times do we repeat?" default answer "")
set theWeight to text returned of (display dialog "Product weight?" default answer "")
repeat theRep times
delay 0.2
tell application "System Events"
tell application process "Safari"
click (clickat {1160, 660}) -- Click Weight
delay 0.2
key code 0 using {command down} -- Select all
delay 0.2
keystroketheWeight-- Insert weight
delay 0.2
click (clickat {1060, 810}) -- Click Save changes
delay 0.2
key code 124 using {option down, command down} -- Go to next tab
delay 0.2
end tell
end tell
end repeat
Mac Pro, macOS Sierra (10.12.6)