I'm a consultant working with different businesses and so I have a separate google chrome profile with each one. Therefore, a lot of my macros need to open websites in a specific profile.
I am using a shell script to do this, but rather than opening a new window every single time, is there a way it can check that specific chrome profile is already open, and if so, add a new tab instead of opening another window?
I'm a newbie to keyboard maestro, and not a coder, so please explain to me like I'm stupid!
Thanks in advance!
I know almost nothing about Chrome, but I think in order for this to work, there'd have to be some difference in the window titles that Keyboard Maestro can see when in one profile versus when in another profile.
Create a very simple one-action macro:
Load Chrome with two different profiles, with a page loaded in each. Then run that macro twice. Is there any information in the window title that lets you know which profile is in use? If so, the problem is solvable. You might also try %ChromeTitle%
and %ChromeURL%
to see if there's unique info in either of those.
If there's no unique info, it may still be solvable, but through some other method that hopefully someone else can come up with :).
-rob.
Thanks for coming back to me!
I've tried and it just returns the name of the website I have open at the time.
Or just "new tab" regardless of the profile I'm using.
That's a bummer. I did a bit of testing and reading, and this seems like it's going to be very tricky. Chrome used to show profile names at the end of the window titles, but it seems that went away a year or so ago.
The only two alternatives I can think of would be to use custom icons for each profile, then to loop through the open Chrome windows using Found Image to see if a certain profile has a window open. That seems messy.
The other option would be a Chrome Extension. There's one called Tab Modifier that lets you create rules. I tested it, and you can make a rule like "URL starts with http," which will be all of them. When that rule is true, you set the tab title to [Client 1] {title}
, and then every tab in that profile would start with [Client 1]
. You'd have to install the extension in all profiles, and set up a similar rule in all profiles.
But if you did that, then it would be possible to check for windows with tabs who start with the client of interest and open a new tab there. Is that a possibly workable setup?
-rob.
You can check using this method through menu with path condition in if-else action
Profiles > profileName
2 Likes