Switch to Named Tab in Google Chrome

Hello!

How to switch to a named tab in Google Chrome, for example name of a tab is "Transactions" how can i switch to it?

Thanks in advance

Perhaps this script from Christopher Stone can assist you. Identify the url of your tab and place it where I've used it for my mail tab and tailor the rest to your needs. Good luck!

Select Google Mail Tab

Keyboard Maestro Actions.kmactions (2.5 KB)

1 Like

Thanks, will try

Works perfectly, thanks a lot!

@ccstone is a God. Seriously. Every script he has produced and shared is pure gold. :sparkles:

3 Likes

Can someone help with modifying this script. I want to instead of changing values everywhere in the script pass in a variable I create in KM to it. I tried doing that but that does not seem to work and I am not sure why.

Here is the script :

go to localhost 300.kmmacros (26.7 KB)

AppleScript doesn’t inherently know what the getvariable command means; only the Keyboard Maestro Engine does, so you first need to tell Keyboard Maestro Engine to set the chrome_link AppleScript variable to the same chrome_link variable that KM uses. Wrap the set chrome_link to getvariable "chrome_link" line in this tell block and I believe it should work as intended:

tell application "Keyboard Maestro Engine"
	set chrome_link to getvariable "chrome_link"
end tell

@nikivi, @gglick has given you the answer.

If you are going to work with AppleScripts in KM, then you might save yourself a lot of time and trouble if you read some of the KM Wiki:

Did you know you can quickly get help from the KM Wiki directly from every KM Action? Just click on the Gear menu, and select "Help".

EDIT: Just posted this pair of macros for you and everyone!
Macro Set to Quickly Get KM Help

As you know, we are always glad to help around here, but you might be able to get the answer faster from the KM Wiki, or by search this forum.

Good luck scripting!

By some reason the script doesn’t work with Safari as it works with Chrome, not sure how to modify it.

Please help :slight_smile:

Sure thing.

Here is the macro I use for Safari by the amazing @ccstone.

It jumps to a URL you specify and even filters between open URLs. Most certainly one of my most used KM macros thus far.

Could you please upload the macro itself?

By some reason the script doesn’t work for me.

Here is one for going to GitHub.

w: github.kmmacros (30.1 KB)

1 Like

Thanks a lot, it works!

Thank you very much for your sharing. I tested in the Safari browser. This macro is available, but I modified it to Chrome. It was invalid and I couldn't find the reason.

This is because the Safari and Chrome AppleScript dictionaries are not compatible.

There's an earlier macro that was written specifically for Google Chrome...

Can this open a Mac Mission Control "Space" Or Desktop if a google chrome window is open in that desktop space that has a URL?

I can't seem to get this to work for what I need which is to say let's say I have 3 monitors total and each of them have their own google chrome window open and set to a URL. let's say I have gmail open on only monitor #2 of 3, and how could I get it so that my second monitor switches over to the correct space?