Results 1 to 3 of 3
  1. #1
    kratzy
    Guest
    Apple Scripting Help
    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

  2. #2
    Kokopelli
    Guest
    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.

  3. #3


    Member Since
    May 26, 2005
    Location
    Walsall, England
    Posts
    243
    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Apple Scripting | iMessage to email . . . .
    By TattooedMac in forum OS X - Operating System
    Replies: 1
    Last Post: 09-01-2014, 11:00 PM
  2. Scripting for DL's
    By anonymust in forum Web Design and Hosting
    Replies: 0
    Last Post: 08-12-2011, 02:18 PM
  3. Apple scripting for a recent Convert with a DeeJay type of application
    By DeeJayGalaga in forum OS X - Operating System
    Replies: 0
    Last Post: 07-25-2011, 01:20 AM
  4. Scripting Help
    By MBPFTW in forum Web Design and Hosting
    Replies: 2
    Last Post: 05-06-2011, 04:56 PM
  5. scripting
    By albmrbo in forum OS X - Apps and Games
    Replies: 0
    Last Post: 01-26-2009, 08:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •