Using Keywords as Replies' Trigger

169 views
Skip to first unread message

peter quitzgard

unread,
Aug 19, 2024, 2:38:09 PM8/19/24
to AutoControl
Hello, is there a way of triggering an action chain, by waiting for a determined keyword to be inserted into a text box? I already have a few actions which use templates to reply
GMail's messages, but I'm currently using a keys' combination to trigger them. The only needed step to replace such keys combination would be making the action waits for a keyword presence into the "reply field" text box, thus triggering the respective action. 

The current action is this:

{"customEntities":{"script":[["55",{"value":{"mdTime":1724092273597,"srcCode":"//example script\nlet htmlFrag = await ACtl.getFile('<desktop>/responses/TEST-REPLY.html', 'html') ;\nawait ACtl.setClipboard(htmlFrag) ;\n"}}]]},"sections":[{"id":3,"name":"EMAIL REPLIES"}],"trigActList":[["47",{"actions":[{"sequence":[{"action":"sendInput","params":{"inputSeq":[{"action":"DU","keyId":82}],"times":1}},{"action":"runScript","params":{"scriptId":"script:55"}},{"action":"clpbrdPaste"},{"action":"sendInput","params":{"inputSeq":[{"hold":0.7,"keyId":511},{"action":"D","keyId":162},{"action":"DU","hold":0,"keyId":13,"repeat":1},{"action":"U","keyId":162}],"times":1}}],"targets":"currentTab"}],"sctnId":"3","title":"Send REPLY","triggers":[{"combins":[{"block":1,"eventId":109,"preconds":[{"keyEvt":160}],"wildcard":2}],"preconds":{"urlTests":[{"part":0,"type":"starts","value":"https://mail.google.com/mail/"}]}}]}]]}

Once a choosen keyword is inserted into the reply field, it should be replaced by the pasted replies' content and get sent by the action.

Thanks.


peter quitzgard

unread,
Aug 19, 2024, 9:39:04 PM8/19/24
to AutoControl
OK, I managed to create something sinilar to what I'm needing:

{"customEntities":{"script":[["58",{"value":{"mdTime":1724116606183,"srcCode":"let inputElem = document.querySelector('[role=textbox]') ;\ninputElem.addEventListener('input', async evt =>{\n\tawait ACtl.sleep(1000)\n\tACtl.execAction('send TEST')\n})"}}]]},"sections":[{"id":3,"name":"EMAIL REPLIES"}],"trigActList":[["50",{"actions":[{"sequence":[{"action":"runScript","params":{"scriptId":"script:58"}}],"targets":"eventTabs"}],"sctnId":"3","title":"Waits for a text input be entered, and then triggers the action part","triggers":[{"combins":[{"block":1,"eventId":2061,"wildcard":1}],"preconds":{"evtUrl":[{"negate":0,"part":0,"type":"starts","value":"https://mail.google.com/mail/"}],"urlTests":[{"negate":0,"part":0,"type":"starts","value":"https://mail.google.com/mail/"}]}}]}]]}

But that will trigger the needed action for any entered values, not for specific keyworkds only. I need the actions get
triggered according to what exact text value was entered, so the needed template will be sent, with a determined action.

Besides, the trigering part seems to be working kind of erraticaly, since while sometimes it will work,
others it will do nothing at all, till I "force" a tabs' "focused" or "unfocused" event. I also tried with the
"activated" and "deactivated" events, but results weree the same. Ideally, the action part should be always "waiting"
for an entered value into that specific text area, disregarding the tab/window focus state, or any other conditions, so
whatever be the time I put something on that text field, the needed actions get executed. Otherwise, the action
will be executed only right after a "focused" or any other kind of event was detected, which seems to be an issue.
 





Message has been deleted

peter quitzgard

unread,
Aug 19, 2024, 9:55:11 PM8/19/24
to AutoControl
The last action invokes the next one:

{"customEntities":{"script":[["57",{"value":{"mdTime":1724108295213,"srcCode":"//example script\nlet htmlFrag = await ACtl.getFile('<desktop>/responses/TEST.html', 'html') ;\nawait ACtl.setClipboard(htmlFrag) ;\n"}}]]},"sections":[{"id":3,"name":"EMAIL REPLIES"}],"trigActList":[["49",{"actions":[{"sequence":[{"action":"runScript","params":{"scriptId":"script:57"}},{"action":"clpbrdPaste"},{"action":"sendInput","params":{"inputSeq":[{"hold":0.5,"keyId":511},{"action":"D","keyId":162},{"action":"DU","hold":0,"keyId":13,"repeat":1},{"action":"U","keyId":162}],"times":1}}],"targets":"eventTabs"}],"sctnId":"3","title":"Send TEST","triggers":[{"combins":[{"block":1,"eventId":57,"preconds":[{"keyEvt":160}],"wildcard":2}],"preconds":{"urlTests":[{"part":0,"type":"starts","value":"https://mail.google.com/mail/"}]}}]}]]}

AutoControl support

unread,
Aug 20, 2024, 6:44:38 PM8/20/24
to AutoControl
The attached file contains a working example.
In order to trigger the auto-insertion, do this:
  1. Open Gmail
  2. Click on "Reply" on any email
  3. Type the word "autoReply1" (without quotes) in the reply box
  4. Press ENTER
The word "autoReply1" will be replaced by the content of the file <desktop>/responses/TEST.html
Insert Gmail auto-reply by keyword.acs

peter quitzgard

unread,
Aug 21, 2024, 2:29:54 AM8/21/24
to AutoControl
That is working fine, but it seems you combined part of the "Send TEST" reply into
the script itself, which will not complete the chain, by actually sending the email using
the "CTRL+ ENTER" GMail's internal shortcuts. I tried deleting the template and the 
clipboard related commands, and then adding the "ACtl.execAction('Send TEST')", so
it takes care of the deleted steps, but it didn't work. I also tried adding the needed
shortcuts using a linked action via the "syntehisize input" option, but it didn't work as
expected.

action.png

If the missing "sending" action could be added into the script itself, or, rather,
it should be somehow linked to another action so the chain completes, it will
be fine either way.

Thanks.

AutoControl support

unread,
Aug 21, 2024, 6:44:48 AM8/21/24
to AutoControl
The attached configuration file also injects CTRL+ENTER.
 
Insert Gmail auto-reply by keyword.acs

peter quitzgard

unread,
Aug 21, 2024, 4:48:47 PM8/21/24
to AutoControl
Alright, that did the trick, now the only needed step would be making
the action get triggered without having to press any key ("ENTER" or others),
but let just the fact the keyword was entered into the text box be enough.
That way, I will be able to use labeled buttons, which will enter/paste specific
keywords to start the sending process.

AutoControl support

unread,
Aug 21, 2024, 8:18:22 PM8/21/24
to AutoControl
Can you please tell more about those "labeled buttons". How do you create them and where will they be located?

peter quitzgard

unread,
Aug 21, 2024, 11:05:11 PM8/21/24
to AutoControl
I'm using a third-party extension*, which will let me add customized reply
buttons next to the GMail's own "Reply", "Forward" and "Add reaction (smiley)" buttons.
I can label them, and once pressed, they will start the reply, insert text and (optionally)
auto reply the messages. Currently, I'm using it for the insert (plain) text part only (since it can't insert rich text),
and it should be right after that when the above action must get triggered, precisely by the keyword insertion.

AutoControl support

unread,
Aug 22, 2024, 8:58:33 PM8/22/24
to AutoControl
The attached file has a working example. You must use it like this:
  1. Open the options of the "Gmail Buttons" extension and remove the text from the "Body Text" field of every button (i.e. leave that field empty)
  2. In the attached script, locate the "labeledReplies" variable and modify it so that it contains your labeled buttons and html files.
  3. Now when you click a labeled button, the html file will be inserted into the reply box and the email will be sent automatically.

Insert Gmail auto-reply by keyword.acs

peter quitzgard

unread,
Aug 26, 2024, 1:02:48 AM8/26/24
to AutoControl

OK, I'd been trying it, and it works as expected most times, but there are a few
occasions when for some weird reason, just a "v" letter gets sent; and that's
quite strange, since I don't see anywhere into the script a "v" being used.

AutoControl support

unread,
Aug 26, 2024, 11:51:08 PM8/26/24
to AutoControl
Maybe if you add a short pause like this: await ACtl.sleep(200) right before this line: await ACtl.execAction('#clpbrdPaste') the problem might go away.

peter quitzgard

unread,
Aug 27, 2024, 6:01:16 PM8/27/24
to AutoControl
Alright, I will try that. Thanks.

By the way, do you accept cryptocurrencies donations?

AutoControl support

unread,
Aug 27, 2024, 11:09:18 PM8/27/24
to AutoControl
By the way, do you accept cryptocurrencies donations?

Only the payment methods available in PayPal and BuyMeACoffee.

peter quitzgard

unread,
Sep 9, 2024, 5:15:00 PM9/9/24
to AutoControl

Hello, the extension got some bugs fixed and now the templates aren't being added
anymore after pressing the customized buttons.

Is there some change I could do, in order to make them work agaian? Thanks.

AutoControl support

unread,
Sep 11, 2024, 4:00:50 AM9/11/24
to AutoControl
They changed the button's class name from "tag" to "tag123". The attached file has the fix.

Insert Gmail auto-reply by keyword.acs

peter quitzgard

unread,
Sep 11, 2024, 11:19:12 PM9/11/24
to AutoControl
It works again, thanks a lot.

Justice in the System

unread,
Oct 24, 2024, 11:10:24 PM10/24/24
to AutoControl

for what it's worth, i seem to recall seeing recently that paypal now has enabled the ability to send and receive crypto to others - not just buy and sell it like they originally had.

i will continue lurking now.
Reply all
Reply to author
Forward
0 new messages