Jump to content


Photo

Need help with AHK spreadsheet application. Will pay


  • Please log in to reply
2 replies to this topic

#1 vuilgat

vuilgat
  • Members
  • 1 posts

Posted 01 June 2012 - 04:13 PM

I'm new to AHK and am having problems getting it to do what I expect.

If you can help (email/phone), I'll pay $50 per hour. It shouldn't take more than 1 or 2 hours.
Basically, I need AHK to copy the contents of a cell in an XLS spreadsheet, Google it, then go to the top page returned by Google. (Chrome is best, but other browsers are ok). That page will be copied and saved as a .txt file using a file name also taken from the spreadsheet.

Sounds simple, but I don't know why I'm having so many problems.

Roy F.
<!-- e --><a href="mailto:feinson@gmail.com">feinson@gmail.com</a><!-- e -->

#2 Guests

  • Guests

Posted 01 June 2012 - 06:09 PM

Step 1) In Excel, Export as CSV

Step 2) Parse the CSV (quite easy to do)

Step 3) Use UrlDownloadToFile Command

Shouldn't take more than 5 minutes. ;-)

#3 jethrow

jethrow
  • Fellows
  • 2549 posts

Posted 04 June 2012 - 06:37 AM

Simple example using AutoHotkey_L:
InputBox, outputvar, Enter a Cell to Google:, , , 220, 100

if ErrorLevel

   return

xl := ComObjCreate("Excel.Application")

xl.Workbooks.Open(A_ScriptDir "\test.csv")

search := xl.Range(outputvar).Value

clip := ClipboardAll

xl.Range(outputvar).offset(0,-1).copy()

FileName := RTrim(Clipboard, "`r`n")

Clipboard := clip

xl.Quit



wb := ComObjCreate("InternetExplorer.Application")

LoadPage(wb, "https://www.google.com/search?q=" search)

LoadPage(wb, wb.document.all("rso").all.tags("A")[0].href)

FileAppend, % wb.document.body.outerText, %FileName%.txt

wb.visible := true





LoadPage(wb, url) {

   wb.Navigate(url)

   while wb.busy or wb.document.readystate != "complete"

      sleep 10

}