I’ve searched Applescript and Xcode forums and I haven’t found an answer to a question I have. I only know basic Applescript and Xcode, unfortunately. I am trying to create an application that will run a timer and detect if the user has pressed a keystroke or mouse button before the timer has finished running. The timer uses a Start button to start the timer and maybe a second button to detect a mouse click:
on clicked theObject
if the name of theObject is "btnStart" then
tell window of theObject
set numTimer to 0
repeat while numTimer is less than 5000000
-- check if key is pressed or mouse clicked
set numTimer to numTimer + 1
end repeat
end tell
end if
end clicked
I haven’t been able to get a second button to work while the script is running. I’d like to avoid using third party software (e.g. Extra Suites) if I can so I can publish this app. Is this possible? I’d be grateful for any help.
XCode 3.0, XCode core 921.0
Model: Mac Pro
Browser: Opera/9.52 (Macintosh; Intel Mac OS X; U; en)
Operating System: Mac OS X (10.5)