Jump to content

Help: Use recipient's name in Gmail in a Snippet


Recommended Posts

Hi everyone, 

 

I love using Alfred every day, and one of my favourites' functionalities are the snippets. 

 

One thing that make me stick to Gorgias Templates, is the possibility to use Gmail recipient's name in templates by using {{to.first_name}}.

 

That looks like this : https://streamable.com/dn0vsx

 

I know that it is not possible to do that with the basic Snippet functionality in Gorgias, but I just discovered the Snippet Triggers, so I was thinking that it could be feasible with it. 

 

 Do you have any idea how I could use recipient's name in Gmail in my Alfred snippets using a workflow element?

 

Thanks in advance!

Link to post
7 minutes ago, lemikeone said:

Do you have any idea how I could use recipient's name in Gmail in my Alfred snippets using a workflow element?

 

I'm afraid this isn't possible without some fairly serious scripting.

 

Gorgias is an extension running inside your browser, so it can easily read the page you're looking at. Alfred (or any other external application) can’t just reach inside your browser like that.

 

It is probably possible to do, but varies from tricky to very difficult depending on which browser you're using. And it will probably break the next time Google changes Gmail.

Link to post

This AppleScript should return the contents of the To: field if you're composing a Gmail message in the active browser tab in Chrome.

 

tell application "Google Chrome"
	tell active tab of window 1 to return execute javascript "document.querySelector('div.aDm>span').innerText"
end tell

 

Execute it in a Run Script action with Language = "/usr/bin/osascript (AS)".

Link to post
49 minutes ago, lemikeone said:

I just published it on Github

 

Bear in mind that it's very likely to break as soon as Google changes anything in Gmail. You'll need to know CSS selectors and how to use your browser's inspector if you want to be able to fix it.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...