on clicked theObject
start progress indicator "spinner" of window 1
tell application ""
set nTime to contents of text field "timeBox" of window 1
repeat nTime times
--stuff to repeat here
end repeat
end tell
stop progress indicator "spinner" of window 1
end clicked
how would i add a stop button to this to stop repeating.
on clicked theObject
start progress indicator "spinner" of window 1
tell application ""
set nTime to contents of text field "timeBox" of window 1
repeat nTime times
--stuff to repeat here
end repeat
end tell
if theObject is equal to "stopbutton" then
exit repeat
stop progress indicator "spinner" of window 1
end if
end clicked
well then edit accordingly. simple as that. i really should have let you figure that one out yourself. i gave you the one line of code you needed. (exit repeat)
on clicked theObject
start progress indicator "spinner" of window 1
tell application ""
set nTime to contents of text field "timeBox" of window 1
repeat nTime times
--stuff to repeat here
end repeat
end tell
stop progress indicator "spinner" of window 1
if theObject is equal to "stopbutton" then
exit repeat
end if
end clicked