Macro works on Mac Studio but not MacBook Pro

Hi Folks,

I have a macro that basically executes some stuff on a web page, waits for results, scrapes the data (just with menu > select all) and and pastes it into a numbers sheet (it pastes as a single column, then transposes that date into a row and copies that row to a table (for further manual analysis). This macro runs in a loop, often times for hours depending what kind of test I am collecting data on (sometimes thousands of iterations), so I set up my laptop to run it on so that it doesn't tie up my Studio.

The problem is, it doesn't run on my laptop. It hangs on the condition "Pause until a menu item with this name is enabled". I've also tried using a "menu item with this path is enabled." Both of these variations work on my Studio, but not on my MacBook Pro. I don't use my MacBook Pro for much of anything (it's a 2017) so I actually wiped the drive and did a fresh install of MacOS thinking there was something going on there.

The interesting thing is if I use debugger and step through each step, it works perfectly fine on my laptop. I'm really not sure where to go to get this working on my laptop. Any help would be appreciated, and I'm happy to provide the entire macro if that helps, just let me know. Thanks!

Share your macro.

EDIT just a minute need to remove some personal info from it lol

Here is the macro.
Brute Force ET-TP.kmmacros (67.5 KB)

EDIT2: It's this section in the take profit loop that is hanging

Am I right to assume the pause until Select All is enabled is there to allow time for the page to refresh?

In this case, you might be able to use the Wait for Safari to finish loading action instead, like so:

Portion of Macro.kmmacros (23 KB)

Macro screenshot

Since the page is "loaded" from that perspective (it's updating data on the page dynamically), I am using the "pause until HTML element is present" section to check if the results are loaded. After that part resolves to true, there is a UI overlay on the page that takes a second to go away. I have found that the "select all" menu item is disabled until this overlay disappears, so that's what I've been using. But in a nutshell, I guess what I really need to test for is this:

  1. Are the results present on the page (this is working fine, and is the "pause until HTML element is present" logic).

AND

  1. Is the UI overlay gone from the page?

#2 is the one that's not working reliably on both machines. If you have any other approaches to this I'm of course open to ideas and greatly appreciate it.

Could you test for the non-existence of a found image of the UI overlay?

That's a great idea... any ideas on how to test for the nonexistence of something? :slight_smile:

Use the Pause Until action, select Found Image from the drop down and select "does not contain".

1 Like

Thank you for this. I had no idea that option was even available. Having said that, this did not work. For some reason KBM is not seeing that the menu items are enabled, so when I go to "select menu item" it fails. What I did find that works is to type the CMD+A key in the macro, now it seems to be working as it should.

No idea why this works on one Mac, and the other one needs the keystroke to "wake it up", but it's fixed now. Thank you for your help!

Do you actually need the menu condition? Perhaps I misunderstand, but isn't the point of the UI overlay image condition to negate the need for any other?

I might not. What I need to do is select all on the webpage (after results are loaded) and copy them. I had originally used CMD+A and then CMD+C, but ran into issues with timing (hence why I was doing it from the menu items). However, I may be able to go back to that now with the image pause condition, negating the need for menu item picking. Either way the macro has been running on my laptop for a few hours now nonstop with no hiccups, so if I make any changes I'll probably duplicate the macro in case I break something :slight_smile:

Thank you for your help again. Very much appreciated!

1 Like