Jump to content

Nuke Google Maps Timeline (AutoHotKey Script)

If you don't know already, Google keeps a record of when and where you've been if you have Google Maps open or if you use an Android phone (I don't think this is an issue on Iphones, I don't have one to test).

Good thing is, you can delete it, bad thing is, you can only do so one date at a time (and each date takes 3 clicks to delete) so it takes ages to delete all of it by hand.

 

I got a bit annoyed by this today and (after I couldn't find any good auto-clickers online that also move the mouse) I decided to make my own with AutoHotKey (btw, this was the first time I used AutoHotKey, so I'm sorry if the script is messy)

 

Few things to do/note before you open the script:

  1. Once the script is started, you can not use the mouse. To stop the script hold down (it is a little un-responsive, but it shouldn't take more than a second) If for some reason you can not stop the script, signing out of windows (with Ctrl + Alt + Del) also stops the script.
  2. The position of the buttons is hard-coded because I could not figure out how to use variables. If the script is clicking in the wrong places, you can either a) set your monitor resolution to 1080p and see if it works, or b) change the values inside the script. (check out the last section of this topic)
  3. Go to the Timeline and click on the newest date that has some location history (highlighted in blue)
  4. Hit Ctrl + G to start the script (it will delete that day and then move to the previous day)
  5. Sometimes the script will get out of sinc or Google will not delete a date (as far as I could figure out this would happen at random, with or without the script running). If this happens, hold down P, go back to the date that was missed and hit Ctrl + G again. (it might need to be deleted a few times)
  6. You can not recover the location data after it is deleted.
  7. After you are done, reload the page, click on the selected month, select "Month - all" and scroll through the timeline to check if you've deleted all of it.

How to run the script:

  1. Install AutoHotKey
  2. Right click on the desktop, select New - AutoHotkey Script
  3. Right click on it and select Edit
  4. Paste the text in the 'spoiler' inside of it, save and then right click - Run (You may need to run it as administrator)
Spoiler

;Google Maps Nuke Timeline

 

;Debug only

;Used to check mouse position if the hard-coded button position is incorrect

^f::

MouseGetPos, xpos, ypos
MsgBox, The cursor is at X%xpos% Y%ypos%.
return

 

 

^g::
toggle := !toggle
{
loop
{
    if (GetKeyState("P")) {
                toggle := !toggle
                break
            }
    
    ;Click on Bin Icon
        MouseMove, 521, 400
        Sleep, 20
        MouseMove, 592, 356
        Sleep, 20
        Click, 579, 352
        Click, 550, 352
        Sleep, 200
        
        
    ;Click on Confirm
        MouseMove, 1203, 662
        Sleep, 20
        MouseMove, 1120, 629
        Sleep, 20
        Click, 1164, 641
        Sleep, 1000
        
        
    ;Click on Previous Day
        MouseMove, 452, 377
        Sleep, 20
        MouseMove, 513, 321
        Sleep, 20
        Click, 467, 353

    Random, RandomSleep, 250, 700
    Sleep, RandomSleep
}
}
return

As you can see, the script is very basic. I would've liked to add variables for the button positions and possibly even a color/image check to find the exact position of the buttons, but I didn't have a lot of time and this script works well enough, so whatever :)

 

How it works:

  1. It checks if the key combination Ctrl + G is pressed and triggers the loop
  2. In the loop, it checks if the key P is pressed and if it is, it stops the loop
  3. It then moves the mouse towards the bin icon's position, clicks once, then moves slightly to the left and clicks again. This is because dates with more location data have a scrollbar and it moves the bin button to the left.  (It also jitters the mouse before clicking because Google has an algorithm that checks the movement of the mouse before it presses that button, but it seems that adding two 'fake' movements in the vague direction of the button (even if their position values are hard-coded) is enough to trick it. (great work Google ;p))
  4. It then waits a little bit and does the same for the confirmation dialogue, then clicks on the previous day button and loops back to the top.

 

 

If the script is clicking in the wrong places here's what you need to do:

  1. Go to the Timeline and hover your cursor over the bin button.
  2. Hit Ctrl + F and take note of the values inside the dialogue box.
  3. Find the section of code that says ";Click on Bin Icon"
  4. Find "Click, 579, 352" (the first click command) and replace the first number with the X value from the dialogue box and the second number with the Y value.
  5. Do the same for the second click command, but this time subtract ~20 from the X value
  6. Now find the two MouseMove commands above the click commands and set their values to the first click's position, but this time add and subtract from both the X and the Y values a random number between 50 and -50 (eg. If your X value is 10 and your Y is 40, you would set the first move command to something like "MouseMove, 60, -10). Be pretty random, these values should not break the script.
  7. Go back to the Timeline and now click on the bin icon, and once the confirmation dialogue has appeared, hover your cursor over the "Delete Day" button, press Ctrl + F and paste those values inside ";Click on Confirm" just like you did at step 4 (note, this time there is only one click command and you don't need to subtract 20 from X.)
  8. Find the MouseMove commands of the ";Click on Confirm" section, hit Ctr + F and change them as in step 6
  9. Go back to the Timeline and hover over the Previous Day button (to the left of the bin), hit Ctrl + F, and follow steps 4 & 6 (or 7 & 8), but inside the  ";Click on Previous Day". Your script should now work :)

 

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, Grx said:

If you don't know already, Google keeps a record of when and where you've been if you have Google Maps open or if you use an Android phone (I don't think this is an issue on Iphones, I don't have one to test).

its not an issue on any device as you can simply disable it in the settings of your phone and it will never be recorded.

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Pixel5 said:

its not an issue on any device as you can simply disable it in the settings of your phone and it will never be recorded.

You can disable it, but Google still has the old data.

Also Google was found a little while back ignoring that setting and collecting data anyway, so I don't fully trust them... (source: https://www.theverge.com/2017/11/21/16684818/google-location-tracking-cell-tower-data-android-os-firebase-privacy)

 

What language did you use for the script?

 

I believe it's AutoHotKey's own language, but I could be wrong. (This was the first time I used it)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×