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 Mar 15, 2013, 07:09 PM   #1
youtheotube2
macrumors newbie
 
Join Date: Mar 2013
Question about applescript program

I have been trying to get applescript to enter a letter and then press enter in Safari. Ive already looked up programs, but they dont seem to work. The text box I need to type into is inside a game, and the programs just reload the page. It isnt necessary to have it press enter, if I could have it click in a specific spot on the screen. The program ive tried is this...
Code:
tell application "Safari"
	tell application "System Events" to keystroke "x" using command down
	tell application "System Events" to key code 52 using command down
	delay (random number from 1 to 10)
end tell
Any ideas?
youtheotube2 is offline   0 Reply With Quote
Old Mar 15, 2013, 08:02 PM   #2
ytk
macrumors regular
 
Join Date: Jul 2010
Is Safari active when this is running? Try adding “activate” after the first line.
ytk 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


All times are GMT -5. The time now is 09:01 AM.

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

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC