AvantGo-Palm sync using a basic AppleScript

Sep 09, '03 08:52:00AM

Contributed by: stiber

I've developed a moderately-crude approach to syncing AvantGo to a Palm OS device. I'm sure that a proficient AppleScript programmer could improve on this, but it does the job. Here's what you need to do:

  1. Set up an account on AvantGo. Download and install the Palm apps ("AvantGo" and "AG Connect").
  2. Get the command line tool malsync. Don't use the AvantGo software that comes with it, however; it's old.
  3. Copy the malsync application to /usr/local/bin, and make it executable by everyone by typing:
    chmod a+rx /usr/local/bin/malsync
  4. On your Palm, set up AG Connect (see item 5 in README_AvantGo that comes with malsync).
  5. Use the following AppleScript to semi-automate the process of doing an AvantGo sync:
    
    tell application "HotSync Manager"
      activate
      open setup
    end tell
    
    set promptString to "Please disable HotSync in HotSync Manager"
    display dialog promptString buttons {"Cancel", "Disabled"} ¬
      default button 2
    
    if button returned of result is "Disabled" then
      -- NOTE: Enter the following THREE lines as ONE line with a space
      -- between 'export' and 'PILOT' and between '/malsync' and '>/tmp'
      do shell script "export PILOTRATE=115200;export 
        PILOTPORT=/dev/tty.USA19QI23P1.1;/usr/local/bin/malsync 
        >/tmp/malsync.log 2>&1 &"
      tell application "Terminal"
        activate
        do script "tail -f /tmp/malsync.log"
      end tell
      set promptString to ¬
        "malsync started; press hotsync button to connect Palm"
      display dialog promptString buttons {"OK"} default button 1
      set promptString to ¬
        "Remember to re-enable HotSync in HotSync Manager"
      display dialog promptString buttons {"OK"} default button 1
    end if
    
I'm sure the AppleScript can be improved, but there are limits, as HotSync Manager doesn't appear to be very scriptable.

Comments (11)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030905212530882