Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dumlovesyou

macrumors newbie
Original poster
Nov 22, 2012
2
0
Hello,

I need to make a small application (fast). I just need to have the b key to be pressed for 10 minutes at 0.1 seconds intervals. Do you know how can I begin? I have just downloaded xcode 3.1.4 and used to use basic, turbo pascal and bit of c++ quite some time ago.

I also tried Automator. I recorded the b stroke and put a loop on, but it does it once and then it blocks on the watch me do. If I tick the ask to continue it loops for as long I asked for.

Thank you in advance!!
 

bumper314

macrumors member
Jun 23, 2009
39
0
Your best bet is AppleScript:

Code:
-- Give yourself 5 seconds to switch to the right app
delay 5

set finishedTime to (current date) + (10 * minutes)

tell application "System Events"
	repeat while (current date) < finishedTime
		keystroke "b"
		delay 0.1
	end repeat
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.