HotSync Scripting

From: macosxhints - Get the most from X! 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:
Set up an account on AvantGo . Download and install the Palm apps (“AvantGo” and “AG Connect”).
Get the command line tool malsync .Don’t use the AvantGo software that comes with it, however; it’s old.
Copy the malsync application to /usr/local/bin , and make it executable by everyone by typing:
chmod a+rx /usr/local/bin/malsync
On your Palm, set up AG Connect (see item 5 in README_AvantGo that comes with malsync).
Use the following AppleScript to semi-automate the process of doing an AvantGo sync:

OS version: OS X

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