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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Run Script with Administrative Privileges during PackageMaker Installation rebello95 Mac Programming 0 Nov 7, 2011 11:27 PM
looking for a specific automation/script for itunes ... > eroxx OS X 0 Jun 4, 2011 07:17 PM
Anyone know where I can hire/commission a task to create script? Lifequest Mac Programming 2 May 23, 2011 12:52 PM
Applescript shell script won't run when display is sleeping BlueRevolution Mac Programming 6 Feb 19, 2011 03:11 AM
iTunes Script Help jason1989 Mac Programming 1 Jan 24, 2011 11:45 AM


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

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

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