How to Automate Copying a Game to a Database in HiArcs

This is a follow-on to this post, but you needn't look at it much. I got the macro to work, and I'll post it below, but now I want more.

can't get copy games... to work in HiArcs

Use case: several times a day, I play a game on chess.com or lichess.org, download the completed game, and open it in HiArcs Chess Explorer (with a click at the bottom of Google Chrome). HiArcs opens, and the screen looks like this:

In the screenshot, a database is selected (My Games) and the latest game is open but not selected. (Sometimes it's the other way around.)

My goal: get HiArcs to copy the game to the database

I have a macro palette that opens when HiArcs is activated. The first macro in it is the one from the earlier. If I click on the macro, this screen pops up:

Caveats:

  • That only works if the game is selected, not the database.
  • If other games are also open, there will be multiple possible targets in the list.
  • If I'm not careful, I could copy the database to the game, not the other way around.
  • I see no way to automate my way around all that, because it's a list of possible targets, not a dialog box KM can fill with "My Games".

Can anyone tell me how to better automate this?


Here is the macro mentioned before:
1) Copy to a Database.kmmacros (2.5 KB)
image

Hey Bobby,

See if the Pause Until action can see the radio buttons in the Copy Games window.

If it an then you can wait until the button exists and then use the Press a Button action to select the right one.

-Chris

That's an interesting idea, but I never thought of My Games in the list as a radio button (or any kind of button), and Pause Until seems to agrees with me and can't detect it as a button. If KM could detect and press the button, that's only half a solution, since it won't work unless the game is selected.

There are quite a few settings, too, and I can't be sure I've chosen them correctly.

copy with Pause Until.kmmacros (3.4 KB)

Open your windows appropriately and run this macro:

List All Windows and Properties of App (KM8+)

If the “Copy game” window is seen then run this macro to find out how much of it System Events can see:

Front Window Analysis Tool Using AppleScript System Events (List UI Elements)

Otherwise your best option (I think) is to use a Found Image.

-Chris

Thanks for trying to help.

I see no sign of "Copy" in results from the first macro. I found no way to save the result as a text file, but here is a picture:

At "title", it lists the currently selected game or database.

The second macro produces a txt file the forum doesn't allow me to post. Here's a partial image showing the relevant game and database, probably because both are open.

Window_UI_Exploration.txt.zip (2.2 KB)

I don't know how I'd take advantage of any of that. Before I pursue the Found Image option, may I ask what image I'd look for? The macro I already have can bring up the Copy command, so I assume you mean I'd have to look up either an image of the current game name (impossible, as it's always a new name) or I'd have to look up the database name (My Games) after bringing up the Copy command ... but that only works if the game is already selected, so it doesn't save me the manual step of selecting it.

Do I understand correctly, or am I missing something?

Thanks again for trying to help, either way.

You can copy and paste the result in the pop-up window.

The forum accepts .kmmacro files, image files, and zip files.

Zip any problematic files before posting to the forum.

** I've taken care of that for you this time.

I'll have more to say, after I've examined things a bit further.

Did you find anything that could help me?