How to grab data with imacro scripts into Google Sheets

novembre 15th, 2014

Few weeks ago, I found an easy and simple way to grab data with some of my imacros scripts on the internet and save it into one google sheet (google doc). Here is the solution:

Actually imacro doesn’t directly work with google documents and google sheets, it is really difficult to find a 100% working way to grab data on google documents and even more difficult to register data on it. My solution: simply use google forms to update your data’s directly to one google sheet and then do whatever you want to do with it. If you want then to update a chart or one table in one of your website page you can easily share the information from Google docs.

My goal was to create an automatically updated dashboard with fresh collected data: total of my disponible cash ordened by domain (I created a lot of accounts which are doing a lot of things automatically on the internet and I wanted to get all the cashflow information on one place). This is easy to do with some dynamic tables and functions in one google sheet.

This is only one example of what it’s possible to do with automatically imacro grabbed data on googlesheet documents, much more things can be done. I plan to do for instance some new scripts to gat a daily updated working proxy list and a monthly updated seo domain metrics…

So let’s show you my secrets in some easy steps:

1/ Create your imacro script with up to 9 variables to upload to your google sheet for each loop. For my needs, I wanted all the data information ordened in different columns in my google sheet document so I defined one variabe for each grabbed data but if you need to grab more than 9 data by loop you can also use imacro EXTRACT=TXT without defined variables and then upload all your data’s separated by commas to your google sheet.

Example for one variable named VAR1 :

SET !VAR1 EVAL(« \ »{{!EXTRACT}}\ ».replace(/^\\s*|\\s*$/g, \ »\ »); »)

2/ Create a simple google form with one blank for each variable you need to upload. Example:

3/ Grab an imacro script filling your form and then replace the filled blank by your variables. Add this script at the end of your first imacro script.


TAG POS=1 TYPE=INPUT:TEXT FORM=ID:ss-form ATTR=ID:entry_604346498 CONTENT={{!VAR1}}

4/ Configure your dashboard from the results sheet that google will automatically update everytime new data’s are submitted into your google form.

Example of results:

5/ That’s it, launch your imacro script with the number of loops you need and your dashboard will be automatically updated with fresh data.

For instance, you can go totally automatic using a .bat file and taskmanager to launch your imacro scripts from a virtual machine or a pc you do not use daily. Doing this will allow you to update your data with the frequence you need.

If you liked this post and it resulted usefull please share it!

You can also add your comments and ask your questions below.

Note: Pour une meilleure diffusion cet article à été réalisé en Anglais. Pour une version traduite automatiquement en Français, cliquez ici.