Jump to content
Macro Express Forums

web site command always opens a new tab


Recommended Posts

yes, thank you, I am aware of the keyboard shortcuts to navigate between tabs once in a browser. What I meant more specifically was if I am NOT in the browser, how do I create a macro to switch to the open or not yet open browser and go to a specific tab/site, without opening a new tab each time if it is already open.


For example am trying to create a keyboard shortcut for checking my Gmail. Most of the time Chrome is already open and a Gmail tab is already open. Sometimes Chrome / Gmail is not yet open. I want the keyboard shortcut to open Chrome / Gmail if it's not open or switch to the existing tab if it is open. Instead what I get it is a new Gmail tab open in Chrome every time I press the shortcut key. Which means by the end of the day I have a million Gmail tabs open unnecessarily.

Link to comment
Share on other sites

Something like this, perhaps?



// T1 is the title bar for the current window.

// This section is designed to help you work out title bar text that shows Gmail is running in Chrome.
// Delete Section 1 after you have figured out a value for T2


Variable Set String %T1% to topmost window title
Text Box Display: Title bar of current window = %T1%
Macro Stop

// T2 is the title bar fragment that indicates Gmail is running in Chrome.

// (I don't use Gmail or Chrome, so I cannot work it out for you! )


Variable Set String %T2% to "Gmail - Google Chrome"
If Window "%T2%" is running
Window Activate: Gmail - Google Chrome
Web Site, "http://gmail.com",using Default Web Browser
End If

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...