Help me build an amazing email template that I can customize on the fly with AHK please! Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
EttVenter

Help me build an amazing email template that I can customize on the fly with AHK please!

03 Nov 2017, 09:51

Hi everyone.

So, Ijust switched from Mac to PC, and one of my favourite apps on the Mac is aText. It essentially takes a keyword I enter and pulls up a massive email that I can customize. I know that I can use TextExpander on PC, but I don't want to pay for it, and I know AHK can do this somehow.

So here's the scenario: I get an email from John, who wants to have a meeting with me on the 10th of May. I want to hit reply, type a Keyword, and then essentially have a dialog with a few inputs for me to enter. Like this:

https://imgur.com/a/UN6wU

All I type into the Dialog is "John" and "10th of May", hit Enter, and AHK fills out a full email that says:

"Hi John! I'm still free on the 10th of May if you'd like to schedule a meeting".

I'd also like to be able to have hyperlinks in that response.

The image above is what it looks like when I do it with aText.

How would I go about doing that?

Another thing I'd like is for Other content to be available, but not entered by default. For example, if John asks if I travel across the country for work, I want a Pre-typed response that explains my travel fees, but I only want that to be added to the message if I click a checkbox or something.

If anyone could help me with this, I'd really appreciate it. Thanks guys!

TL;DR: I need to be able to enter a few variables, and AHK needs to populate a pre-typed email with those variables, and enter the full email into the text dialog I currently have selected.
BoBo
Posts: 2515
Joined: 13 May 2014, 17:15

Re: Help me build an amazing email template that I can customize on the fly with AHK please!

03 Nov 2017, 12:09

Use one of AHK's COM scripts to send the mail. It's possible to send standard HTML formated mails that way.
Regarding the input, it's not that difficult to create a GUI with the respective input fields that will create + send a mail with the push of a button.
Good luck :)

PS. Cross check your sample. It contains a typo/duplicate text at its bottom section.
FanaticGuru
Posts: 1164
Joined: 30 Sep 2013, 22:25

Re: Help me build an amazing email template that I can customize on the fly with AHK please!

03 Nov 2017, 14:47

list-nli wrote:You can try Lintalist - https://autohotkey.com/boards/viewtopic.php?f=6&t=3378 - it can do rich text, video https://www.youtube.com/watch?v=J1StUar ... e=youtu.be (you can ask for user input, pick a date in a calendar etc)
I agree that Lintalist would be the easiest.

You could make a pretty Gui like in the picture but it is a lot of trouble.

This is the snippet that would do basically what you want in Lintalist:

Code: [Select all] [Download] GeSHi © Codebox Plus

Hi [[Input=Person's Name?|John]]! I'm still free on the [[Calendar=dd of MMMM]] if you'd like to schedule a meeting.


Easy to edit and change at any time. It does not put the "st nd rd th" Ordinal indicator after the number. You would have to create a plugin for Lintalist which is not all that hard.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
list
Posts: 99
Joined: 26 Mar 2014, 14:03
Contact:

Re: Help me build an amazing email template that I can customize on the fly with AHK please!

03 Nov 2017, 17:17

@FanaticGuru you could use local variables, granted you'd have to create 31 of them (day1, day2 etc)

Code: [Select all] [Download] GeSHi © Codebox Plus

Hi [[Input=Person's Name?|John]]! I'm still free on the [[Split_Date=[[Calendar=d of MMMM]]|\s]] [[var=Day[[Sp_Date=1]]]] [[Sp_Date=2]] [[Sp_Date=3]] if you'd like to schedule a meeting.

So here for example [[var=Day[[Sp_Date=1]]]] translates to (today) [[var=Day3]] and if your local variable contents is 3rd the end result is

Hi John! I'm still free on the 3rd of November if you'd like to schedule a meeting.
list
Posts: 99
Joined: 26 Mar 2014, 14:03
Contact:

Re: Help me build an amazing email template that I can customize on the fly with AHK please!

03 Nov 2017, 17:25

Or directly without variables using named splits (you need to ask the date first here)

Code: [Select all] [Download] GeSHi © Codebox Plus

[[Split_Date=[[Calendar=d of MMMM]]|\s]]
[[Split_Day=1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st|\s]]

Hi [[Input=Person's Name?|John]]! I'm still free on the [[SP_Day=[[SP_Date=1]]]] [[Sp_Date=2]] [[Sp_Date=3]] if you'd like to schedule a meeting.

;)
EttVenter

Re: Help me build an amazing email template that I can customize on the fly with AHK please!

04 Nov 2017, 07:49

Holy smokes, guys, that's EXACTLY what I needed! Thank you so much!

I have two follow up questions:

1) I can't seem to have my original AHK scrip running while this is running. Any idea what's up with that?

2) Now, I've got it doing almost all of what I want. I need something a little extra. Sometimes, the exact same email might need some extra text, also pre typed, but I want to be able to select whether or not that text makes it in. So maybe after the name, after the date, I want it to ask me if it should include THIS or THAT bit of text. How would I go about doing that?

You guys are doing God's work. Thank you!
list
Posts: 99
Joined: 26 Mar 2014, 14:03
Contact:

Re: Help me build an amazing email template that I can customize on the fly with AHK please!

04 Nov 2017, 09:26

Glad you like it :-)

There are various ways to go about it, probably the easiest would be to:

  • create two snippets (open the gui, press the New snippet button or F7)
  • the first one is empty (just type a space in Part 1) and give it the shorthand snipno (very important)
  • the second one has your extra text - just type what you need in Part 1 - and give it the shorthand snipyes (very important)
  • copy the code below and add it to your main snippet (the one with the name & date questions above) where you want it to appear:

    Code: [Select all] [Download] GeSHi © Codebox Plus

    [[Snippet=snip[[Choice=?Include Additional Text?|No|Yes]]]]
  • Now start the main snippet (remember you can assign keyboard shortcut or shorthand) - now it will ask you "date" "name" and a YES/NO question, NO is default, if you just hit enter nothing will be added to your main snippet, if you select YES the additional text will be inserted and pasted together main snippet)

I don't know what could be the cause of your other AutoHotkey script not working, perhaps start Lintalist first, then your script. I have several scripts running all the time including Lintalist and never have any problems.
EttVenter

Re: Help me build an amazing email template that I can customize on the fly with AHK please!  Topic is solved

04 Nov 2017, 11:09

list wrote:Glad you like it :-)

There are various ways to go about it, probably the easiest would be to:

  • create two snippets (open the gui, press the New snippet button or F7)
  • the first one is empty (just type a space in Part 1) and give it the shorthand snipno (very important)
  • the second one has your extra text - just type what you need in Part 1 - and give it the shorthand snipyes (very important)
  • copy the code below and add it to your main snippet (the one with the name & date questions above) where you want it to appear:

    Code: [Select all] [Download] GeSHi © Codebox Plus

    [[Snippet=snip[[Choice=?Include Additional Text?|No|Yes]]]]
  • Now start the main snippet (remember you can assign keyboard shortcut or shorthand) - now it will ask you "date" "name" and a YES/NO question, NO is default, if you just hit enter nothing will be added to your main snippet, if you select YES the additional text will be inserted and pasted together main snippet)

I don't know what could be the cause of your other AutoHotkey script not working, perhaps start Lintalist first, then your script. I have several scripts running all the time including Lintalist and never have any problems.


Holy SMOKES! That's it! You've helped me replicate exactly what I was doing with aText on the Mac. I can't thank you enough.

And I seem to have solved the issue with both AHK and Lintalist running at the same time. Thank you!

Return to “Ask For Help”

Who is online

Users browsing this forum: eqv, lluke, sn0365, swagfag, TheDewd, ToKa, tonkomnom and 65 guests