Matt Carver

Animal Rescue Site Click-To-Give Script

Updated!

I have developed a little Visual Basic script which performs the “click” operation on the Animal Rescue Site to make donating those bowls of food to animals an extremely simple task. Just cut and paste the following code (in the codeblock below) into Notepad and save it to your desktop with a .vbs extension. Double-click the script on your desktop to launch it. If your using Windows 2000, XP, 2003, Vista, and Windows 7.  Enjoy!

On a side note: If you change the “Vis=1″ to “Vis=0″, you can hide IE from being displayed.

Dim objIE, objDoc, sURL, intClick, Vis
sURL="http://www.theanimalrescuesite.com/clickToGive/home.faces?siteId=3"
Vis=0 ' -- Toggle Visibility 0=invisible mode 1=show IE

set objIE = WScript.CreateObject("InternetExplorer.Application")
objIE.navigate(surl)
objIE.left=0
objIE.top=0

If Vis = 1 Then
  objIE.visible=false
Else
  objIE.visible=true
End If

' --- Wait for page to finish loading ---
WaitForLoad(objIE)

' --- Submit the clickToGiveForm
objIE.Document.getElementById("j_id67:clickToGiveButton").Click()

' --- Wait for page to finish loading ---
WaitForLoad(objIE)

If Vis = 0 Then
  MsgBox "Click Script Complete!  Thanks for Donating...",, _
    "Animal Rescue Click Script"
  objIE.Quit
  Set objIE = Nothing
Else
  ' --- Display MsgBox ---
  intClick = MsgBox("Click Script Complete!  Click OK to exit IE or " & _
    "Cancel to leave the window open", 1, "Animal Rescue Click Script")

  ' --- Close IE depending on selection ---
  If intClick = 1 Then
    objIE.Quit
    Set objIE = Nothing
  End If
End If

' --- WaitForLoad Subroutine ---
Sub WaitForLoad(objIE)
  while objIE.busy
    WScript.Sleep(50)
  wend
  Do While objIE.Document.ReadyState <> "complete"
  Loop
End Sub

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...