Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 3, 2005, 01:55 AM   #1
Poff
macrumors 65816
 
Poff's Avatar
 
Join Date: Sep 2003
Location: Stavanger, Norway
Kayboard script?

I have this game where I sometimes go to the market and try to sell things. Is it possible to write an applescript, or get a little program, that will write the same things again and again? (I cannot copy and paste)

I can get tired of writing "selling steel sword" a thousand times in a row sometimes..
__________________
A computer you had to learn how to use was a bad idea from its birth.
Poff is offline   0 Reply With Quote
Old Feb 3, 2005, 02:15 AM   #2
HexMonkey
Administrator
 
HexMonkey's Avatar
 
Join Date: Feb 2004
Location: New Zealand
You can use AppleScript to send some keystrokes to an application as follows:

Code:
tell application [Application name] to activate
tell application "System Events" to keystroke "selling steel sword"
You can then use a repeat loop to do this a fixed number of times or until a condition is met, for example:

Code:
tell application [Application name] to activate
repeat with i from 1 to 20
	tell application "System Events" to keystroke "selling steel sword"
end repeat
You might need to hit the return key after entering a phrase. To do that with AppleScript, just add "& return" after the keystroke command as follows:

Code:
tell application "System Events" to keystroke "selling steel sword" & return
HexMonkey is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Need help on script flash1996 Mac Basics and Help 1 Oct 28, 2013 09:22 PM
Apple script batch shell script prramesh Mac Programming 5 Sep 15, 2013 03:35 AM
kayboard hide when reload table kikko088 iPhone/iPad Programming 10 Nov 12, 2012 02:35 PM
first script/autamator script feed back zyr123 Mac Programming 1 Jul 17, 2012 10:00 AM
Help on Script Mdv2 Mac Applications and Mac App Store 0 Jun 7, 2012 02:45 PM

Forum Jump

All times are GMT -5. The time now is 02:38 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC