Hotkeys for Google Earth

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
orto
Posts: 4
Joined: 12 Jun 2021, 08:06

Hotkeys for Google Earth

12 Jun 2021, 08:13

Hello.
I would like to create a hotkey (ctrl + s) to save the current kml file.
Please help me.
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Hotkeys for Google Earth

12 Jun 2021, 09:18

I was experimenting with the desktop version. It would be straightforward to use ImageSearch to find and click on the "Copy" icon, and then use FileAppend to save the text to a file. If you need more details, feel free to post.
User avatar
orto
Posts: 4
Joined: 12 Jun 2021, 08:06

Re: Hotkeys for Google Earth

12 Jun 2021, 09:47

mikeyww, thank you very much for your reply!

I have a kml file.
I would like to reposition the label and save the result.
To do this, I right-click on and select “Save Place As...” (Screen1).

This will open a Windows Explorer window (Screen2).

I would like to avoid these steps.
So that I can press “Ctrl + S” and so that the current kml file is saved. Without any windows appearing.


* I am using Google Translate.
Attachments
Screen2.jpg
Screen2.jpg (37.99 KiB) Viewed 381 times
Screen1.jpg
Screen1.jpg (42.86 KiB) Viewed 381 times
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Hotkeys for Google Earth

12 Jun 2021, 10:14

This worked in my test.

Code: Select all

kml = %A_ScriptDir%\test.kml

#IfWinActive ahk_exe googleearth.exe
F3::
Clipboard := ""
Send ^c
ClipWait, 0
If ErrorLevel {
 MsgBox, 48, Error, An error occurred while waiting for the clipboard. Aborting.
 Return
} Else FileRecycle, %kml%
FileAppend, %Clipboard%, %kml%
Run, notepad.exe "%kml%"
Return
#IfWinActive
User avatar
orto
Posts: 4
Joined: 12 Jun 2021, 08:06

Re: Hotkeys for Google Earth

12 Jun 2021, 10:28

mikeyww, thank you so much!
This will help me a lot.
Sorry. After pressing F3, a text file opens for me.
Is it possible to prevent the text file from opening? So that the changes are immediately saved to the kml file. Without opening any windows.
Attachments
Screen3.jpg
Screen3.jpg (88.87 KiB) Viewed 314 times
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Hotkeys for Google Earth

12 Jun 2021, 12:07

Yes. You can delete line 13.
User avatar
orto
Posts: 4
Joined: 12 Jun 2021, 08:06

Re: Hotkeys for Google Earth

12 Jun 2021, 12:21

mikeyww, It is very cool.
Thank you very much.
You helped me a lot.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder, ruespe and 352 guests