Although you'll have to heavily customize this for your situation, this is the code I'm using to log into AT&amp;T's website and retrieve data usage information, then log out. The crucial part here is the wait() function. This is much better and more reliable than arbitrary delays. It checks for the status of Safari's reload button, and continues when it indicates the webpage is done loading. You can use Safari's web inspector to get element IDs and stuff. If you need any further help making this work, don't hesitate to ask!

set username to "username"
set _password to "password"

tell application "Safari"
    set new_document to make new document with properties {URL:"https://www.att.com/olam/loginAction.olamexecute"}
    tell me to wait()
    tell tab 1 of window 1
        do JavaScript "document.getElementById('userID').value = \"" &amp; username &amp; "\""
        do JavaScript "document.getElementById('password').value = \"" &amp; _password &amp; "\""
        do JavaScript "document.getElementById('LoginButton').children[0].click()"
        tell me to wait()
        set URL to "https://www.att.com/olam/displayUsageLanding.myworld?reportActionEvent=A_UMD_CURRENT_USAGE_SUMMARY"
        tell me to wait()
        display alert (do JavaScript "document.getElementById('WebUsage1').children[0].children[0].innerHTML")
        do JavaScript "document.getElementById('ge5p_z2-user-auth').click()"
        tell me to wait()
    end tell
    close window 1
end tell

on wait()
    delay 1
    tell application "System Events"
        tell application process "Safari"
            set shouldExitRepeat to false
            repeat
                try
                    repeat with curButton in (buttons of text field 1 of group 2 of toolbar 1 of window 1)
                        if name of curButton is equal to "reload" then
                            set shouldExitRepeat to true
                        end if
                    end repeat
                    if shouldExitRepeat then
                        exit repeat
                    end if
                end try
                delay 1
            end repeat
        end tell
    end tell
end wait


Browser automation using Applescript
I plan to buy a new wifi router with the intention of installing dd-wrt right away. One of the features I plan to use is attaching a USB harddrive to the router and using it to backup (using rsync) my laptop and desktop. 

As far as I can google, dd-wrt shares files through SAMBA. I know it's not the prefered option for Ubuntu users and we would prefer NFS, but does anyone know how bad or good it is this setup? 

Does anyone here use dd-wrt as a file server succesfully?
