I have a dialog prompt asking how many times to click a certain element in the Numbers formatting panel, but it keeps telling me the result is not an integer. I’ve tried explicitly setting it as such but keep getting the same error. Would be nice to also ensure the entry is a number and not a text string, and if the latter to not proceed or tell the user to try again.
tell application "System Events"
tell application process "Numbers"
set clickNumber to display dialog "How many clicks?" default answer "" as integer
tell window 1
repeat clickNumber times
click UI element 1 of incrementor 2 of scroll area 3
end repeat
end tell
end tell
end tell