How can script check clipboard and if specific string is found add extra function to script?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Posts: 71
Joined: 08 May 2019, 14:41

How can script check clipboard and if specific string is found add extra function to script?

18 Nov 2019, 11:30

Hi you all sexxy people of AHK, I have a mailing list, that basically I type in the territory code and it just brings up the contacts for the territory. It's all been peachy, but recently it has been brought up to my attention, that for very specific projects I have to Carbon copy all emails to a specific person. So I have been given a list with specific "Project ids" (5 digit strings)

What would it take for me to have a script that can check if project ID matches specific and if it does to add a carbon copy, (that part I can probably figure out easily) I mostly need help with the logistics of the script comparing the clipboard.

So my list is a whole bunch of "territory" codes that look like this. I input it in the sender's list and basically grabs me the correct contact and pastes clipboard as subject.

Code: Select all

::..nc02::Eric Pasta; {tab} {tab}^v {tab} {return}Hello Eric, {Return}

::..ne01::Jon Whiskers; Evan Traffic light; {tab} {tab}^v {tab} {return}Hello, Jon, Evan {Return}

::..nj01::Paul Rastajama; {tab} {tab}^v {tab} {return}Hello Paul, {Return}

Clipboard changes but it look something like this, and it always follows the same pattern:

Code: Select all

CA09 - 54199 - Regular business brand name - Center of things - 2099 Dickenson drive
Basically "4 digit territory ID"{space}-{space}"5 digit Project ID"{space}-{space}"Business owner"{space}-{space}"Business store"{space}-{space}"Address"

I think we can focus on the first part to make this script work. And I have a list like this:

Code: Select all

NC02			68911	OVEL STUFF				Eric Paper	
NC02			79278	OVEL THANGS				Eric Paper	
So if I was sending an email to NC02 specifically project 68911 or 79278, I would need to CC eric paper in the mailing list.

I have a faint idea of how this would work, but knowing me, I'd probably get the syntax very wrong, so it really helps when people write the correct syntax and explain the basic process.

Thanks. Do hit me up if this isn't easily understandable.

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, Google [Bot], Melchisedek, mikeyww, NicolaLearnsAHK, songdg, tatermakes and 59 guests