My First Applescript, Need Advice

Discussion in 'Mac Apps and Mac App Store' started by bellis1, May 1, 2005.

  1. bellis1 macrumors 6502

    Feb 9, 2003
    Can someone give me advice on how I could improve this applescript. I just want it to click the ok button in a dialog box which comes up when the program first opens and again when a dialog box comes up after it completes it's processes. This is the only way I figured out how to do it but I would suspect there is an easier way and there might be an occasion when the process takes over 100 seconds. This is my first adventure into using applescript. My next step is to use automater in combination with sailing clicker and isync to automate my calendar, etc. on my phone everytime I walk into work.

    tell application "Finder"
    select Finder window 1
    open application file "Sync" of folder "Sync Entourage-iCal 2" of folder "Applications" of startup disk
    end tell

    tell application "System Events"
    tell process "Sync"
    delay 10
    keystroke return
    delay 100
    keystroke return
    end tell
    end tell
  2. mkrishnan Moderator emeritus


    Jan 9, 2004
    Grand Rapids, MI, USA
    Bellis, take a look at this thread:


    Thumb and I figured out some pretty good ways to do things similar to this. I have had my phone on hourly iSync for more than a week now? And I've been very satisfied. There are actually NO button presses involved at all -- iSync starts and quits itself, whether or not sync is successful.

    There is also a link in the thread for incorporating Sailing Clicker. But my recommendation would be that syncing every 100 seconds is going to have deleterious effects on your battery, isn't it? Does your schedule really change so frequently? :(

Share This Page