Activating Google Chrome - hindered by what? - macro not working

Hi and good day,

In this macro activating Google Chrome is step 1, but not working bec. of someting that follows it in the macro, but I don't know what.

Added a lot of pauses, without success!

If I activate G. Chr. manually, it'll work.

BTW, a very crude bitly url shortener, because I haven't found a functional anywhere.

/
with best regards,
Omar K N
Stockholm, Sweden

To start with, I don’t think you need the AppleScript. From what I see, KM can do all of that.

There’s also a Google Chrome Library somewhere, which includes filling in a form. Perhaps that would be better than trying to hit a button with absolute coordinates.

Hi and good day Carey,

Thank you - yes I found a lot of G. Chr. actions!!!

=> I’ll move this to a new thread, as I’m still wondering what does stop my macro above.

Hope someone can chime in…

/
with best regards,
Omar K N
Stockholm, Sweden

Check the Engine.log, which reports any action failures (Help ➤ Open Logs Folder).

Where does the macro stop? Include Log actions and again check the log file to see where it gets to.

Whenever using an Execute Script, ensure that it is displaying the results so you can see any errors generated.

Hi and good day Peter,

Finally I built the macro anew from start (with a short pause* of < 1 sec before the Apple Script - which maybe helps?)

When I had rebuilt it, it just worked, so there must have been some hick-up (deeper) in the system :slight_smile:

If you can comment please, also re: the short pause* at the start of everything.

/
with best regards,
Omar K N
Stockholm, Sweden

Hey Omar,

Who knows.

Get rid of the Keyboard Maestro activate action and just use the AppleScript.

tell application "Google Chrome"
  if not running then run
  activate
  tell (make new window)
    set URL of active tab to "https://bitly.com/a/bitlinks/1HPMkB7"
    set bounds to {1280, 0, 2559, 1200}
  end tell
end tell

You probably can remove the filter portion of the URL “1HPMkB7” in the script.

Put a Pause Until Google Chrome Has Finished Loading action after the script.

-Chris

Hi and good day Chris,

Thank you, taking in advice.

However I'm not sure if I can find this action in KM:

Put a Pause Until Google Chrome Has Finished Loading action after the script.

What I can find are two:

a.) Wait for Google Chrome to Finish Loading.
For at least 2 seconds.

or

b.) Pause Until Conditions Met: Google Chrome is at front.

I think it's a.)

/
with best regards,
Omar K N
Stockholm, Sweden

Hey Omar,

Yes I had the name slightly wrong Wait For Google Chrome to Finish Loading is correct.

-Chris

Just for future reference: the macro was SOLVED when I

REBUILT the same macro once more with the same actions,

so now it’s working!

/
okn

It would be very unusual that rebuilding the macro exactly results in different behaviour. But if you would like to send me an export of both macros I am happy to look to see exactly what tiny differences there might be.

Hi and good day Peter,

By now I've deleted the old non-working versions, but I found the one below from (Why does my Google Chrome macro only work when I manually activate it?)

They never started to run, no logg entry, and I got the System error sound. And quitting the engine and restart of the Mac didn't help either. Probably some extremely stupid mistake,...

Keyboard Maestro Actions.kmactions (3.6 KB)
Name of macro: get bitly url test3 defect

/
with best regards,
Omar K N
Stockholm, Sweden