New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

Apple Scripting Help


Post Reply New Thread Subscribe

 
Thread Tools
kratzy
Guest
 
Posts: n/a

Hello all! I posted the other day in the Anything Goes forum about looking for some kind of macro/bot that would produce a mouse click every 2 minutes or so. Someone suggested putting the following into Apple script:

tell app "system events"
repeat
delay 60
click
end repeat
end tell

I'm not sure this is correct but I'm fairly certain that with some tweaking this is on the right track. Anyone know a bit about apple script? thanks in advance

Kratzy
QUOTE Thanks
Kokopelli
Guest
 
Posts: n/a

Well it was close. There are two problems. The first is that a repeat needs a type and a conditional. That is easily solved.

Code:
tell application "System Events"
	
	repeat while true
		delay 60
		click
	end repeat
	
end tell
The second is that click simulates a click upon some UI element. Since no UI element is specified I am not sure if the OS will actually register the mouse as clicked.

P.S. If you want to confirm the loop just add a sialog inside the loop. that is what I did.

Code:
	display dialog "Loop Ran" buttons {"OK"} default button 1
p.p.s might want to run it from script editor or change it to a for loop. Not sure how you would kill an applescript running in an infinite loop.
QUOTE Thanks
zeta101

 
Member Since: May 26, 2005
Location: Walsall, England
Posts: 243
zeta101 has a spectacular aura about

zeta101 is offline
Quote:
Originally Posted by Kokopelli
p.p.s might want to run it from script editor or change it to a for loop. Not sure how you would kill an applescript running in an infinite loop.
Won't an applescript show up on the dock like an application would while it's running? You should be able to quit or force quit that way if there is ever a problem...right?
QUOTE Thanks

Post Reply New Thread Subscribe


« Donation site.... | 1and1.com »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
The Beatles sue Apple over iPod, iTunes Murlyn Apple Rumors and Reports 52 05-24-2006 10:57 AM
Scared for my iBooks sake! X Im just meE o Apple Notebooks 27 12-19-2005 11:41 AM
Apple can make a powerbook g5 easily Sexyboy Apple Notebooks 46 07-15-2005 06:41 PM
Apple Going After Microsoft? rs2sensen Schweb's Lounge 22 07-08-2005 03:07 PM
Go Apple, Go Applr, Go Baby go... ByzantineRemnant Apple Notebooks 2 01-03-2005 09:15 PM

All times are GMT -4. The time now is 11:22 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?