Jump to content
macdoe

Change Email 'Use Gmail to Compose..' to use already open Gmail Tab

Recommended Posts

We could use an AppleScript like this for Chrome. I modified this simple script: https://github.com/mobjack/MacChromeCalendarFocus

Still having a little trouble focusing the correct window. If anyone can help on that please let me know what's missing: 

tell application "Google Chrome"
	repeat with w in windows
		set i to 1
		repeat with t in tabs of w
			if URL of t starts with "https://inbox.google.com/" then
				set active tab index of w to i
				set index of w to 1
				tell application "Google Chrome" to activate
				tell application "System Events"
					keystroke "c"
				end tell
				return
			end if
			set i to i + 1
		end repeat
	end repeat
	open location "https://inbox.google.com/"
	tell application "System Events"
		keystroke "c"
	end tell
	
end tell

tell application "Google Chrome" to activate

Share this post


Link to post
Share on other sites

Regarding window focus, I think you can usually just tell the window object to activate.

I'm not sure using an existing tab is sensible default behaviour.

If you have multiple Inbox tabs open, unwanted things could happen. Using a new tab/window ensures you don't muck up a user's window.

Share this post


Link to post
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.

Guest
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...