Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Action's Trigger Working Erratically

118 views
Skip to first unread message

peter quitzgard

unread,
Mar 16, 2025, 9:05:34 PMMar 16
to AutoControl Community Forum
Hello, I created an action which does what I need,
but it doesn't get triggered all the times, but irregularly.

I leave you the action attached.
You should replace the "test.com" URL with the one I sent you.

The weird thig about it is, I found that if I open the
"Developer tools" window, the action will start working
all the times I try it; then, after closing it, it will go back to
work erratically.

To test it, just enter any "letters" only value into the search box,
for example, "dsgsdg", and press the available button or the "Enter" key.
A new webpage (with the same URL) should appear, showing an error message.
Then, when the action works correctly, the original webpage should be opened
and after a second, the search box should get focused.

When it doesn't work, the error message webpage keeps opened.

Thanks.
Test Action.acs

peter quitzgard

unread,
Mar 17, 2025, 8:24:16 PMMar 17
to AutoControl Community Forum
Hello, after trying it with other actions which include scripts which work erratically,
I just realized that the "developer tools" opening workaround is also working with them.
Basically, the same applies, if I leave the "developer tools" window opened, all the steps
will be completed as expected; contrarily, they will work only sometimes, while others I have to
"force" a trigger to activate them, (tab's focus, tab's reloads, etc.).

I bet this strange behavior must be the culprit and root of the problems I commented some months ago,
regarding some actions not working correctly:




Regards.

AutoControl support

unread,
Mar 21, 2025, 12:31:21 AMMar 21
to AutoControl Community Forum
The issue seems to be a bug in AutoControl. When the time between the "Tab load begins" and the "Tab load ends" event is too short, none of the two events will be detected.
Since the test page you provided via email is a very lightweight page, it loads almost instantly. i.e. there's almost no delay between beginning and ending the loading process. This is triggering the aforementioned bug.
Unfortunately, we can't provide an immediate solution. We'll have to investigate some more about how to solve the issue.

peter quitzgard

unread,
Mar 21, 2025, 4:17:54 PMMar 21
to AutoControl Community Forum
I see, but in the test action I sent you, there is only a "Tab load ends" event,
and in the rest of actions I tested, I don't have any  "Tab load begins" event neither,
but mainly "Tab load ends, "Tab focuses" and "Window focuses". Anyway, it is still
a mystery why leaving opened the "Developer tools" window, will fix the issue.

I could share some details of the rest of the actions involved, in case you need it.

I will keep using it like that as a workaround, till you find a solution.

Thanks.
Message has been deleted
Message has been deleted
Message has been deleted

cw noway

unread,
Mar 22, 2025, 3:39:36 AMMar 22
to AutoControl Community Forum
I am NOT AC support, just a guy trying to help...

Hope it helps,

cw



One possible problem is that your "if" statement in your first RUN SCRIPT (see bottom of this message) is not in the proper format.

It is missing the opening and closing brackets and the instructions contained within the brackets that are supposed to

take place if the "if" results is true (truthy).

Because of that improper 'if' statement, everything that follows will be improperly executed, or not executed at all.

Also, you may want to change your trigger  to "Tab load begins" by selecting "A tab starts loading a page" in the dropdown "events" list.
Also, you may want to place a checkmark into the "Run Asynchronously" box on the RUN SCRIPT item.


Redo your RUN SCRIPT code and see what happens.  Maybe with something like this:


// ----------------
// Run Script code
// ----------------

function getElementByXPath(path) {
try {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
        } catch(ex) {
alert(ex.message);
        }
}


$(document).ready(async function() {
// - OR -
// $(async function() {});  // <-- A short version of '$(document).ready'

// $(document).ready JQUERY HELP->  https://api.jquery.com/ready/

try {
// ---------------------------------
// Do what you want to do from here
// ---------------------------------

if (!getElementByXPath("//div[contains(@class,'error')]")) {
// - OR -
// if(!document.querySelector('div.error')) {
// - OR -
// if(!document.querySelector('div[class="error"]')) {

return ACtl.STOP_CHAIN;

} else {

await ACtl.sleep(1000);
ACtl.openURL('TEST.COM', '#currentTab');
}

} catch (ex) {
alert(ex.message);
}

}); // $(document).ready(async function() {
//  End of Code




-----------------------------------------------------------------------------------
HERE IS YOUR CURRENT "RUN SCRIPT" CONTENTS:
-----------------------------------------------------------------------------------
function getElementByXPath(path) {
    return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
}

if ( !getElementByXPath("//div[contains(@class,'error')]"))

return ACtl.STOP_CHAIN ;

await ACtl.sleep(1000)

ACtl.openURL('TEST.COM', '#currentTab') ;
-----------------------------------------------------------------------------------

peter quitzgard

unread,
Mar 22, 2025, 6:00:44 PMMar 22
to AutoControl Community Forum
Hello, thanks for your help, but after trying your script's version
I found it didn't work at all. Anyway, I'm no expert at all, but I don't think
there is any problem with the script in itself, but some kind of bug interfering
specifically in some websites the actions are being performed.

Moreover, I leave the same script, but with another "target" website,
which works perfectly fine, all the times, an without having to open
the "developers tools" at all.

Provided it finds any of the words (You submitted a form....) after pressing the
"Code In It" button, It will return to the initial webpage,, and make focus on the
"Category" selector.
Test-Script.acs

cw noway

unread,
Mar 22, 2025, 6:37:18 PMMar 22
to AutoControl Community Forum
Oh ok, my pleasure.  I'm glad to hear that you are accomplishing what you have set out to do with your current configuration.

That's good news.  Take care,

cw

AutoControl support

unread,
Mar 23, 2025, 7:48:53 PMMar 23
to AutoControl Community Forum
I see, but in the test action I sent you, there is only a "Tab load ends" event,

The bug we described in our previous reply will happens even if you don't have any "Tab load beings" or "Tab load ends" triggers. The bug affects both events in all circumstances. If the time between the two events is too short (few milliseconds) none of the two events will be detected.
 
 
it is still a mystery why leaving opened the "Developer tools" window, will fix the issue.

When the DevTools panel is open, the entire browser runs slower. This is because DevTools performs all sort of monitoring tasks and it also builds activity logs such as the Network panel of the Console panel.
Therefore the time between the two aforementioned events will be significantly longer and so the bug will not happen.

We are still investigating on how to solve this. It'll take some time.

peter quitzgard

unread,
Mar 24, 2025, 2:34:39 AMMar 24
to AutoControl Community Forum
Alright, now I understand it better. The other webpages where I execute scripts which involve such
kind of events as triggers, will also behave erratically, even when they aren't that light weighted as
the one I sent you to test. Maybe adding some kind of optional delaying value to those specific triggers
will serve for websites which load that fast. Not that I believe it would be that easy, I'm just thinking out loud,
of course.

peter quitzgard

unread,
Mar 28, 2025, 4:01:28 PMMar 28
to AutoControl Community Forum
An update, for informative purposes only.

I was using two different portables, and in the one that was working rightly for the actions I need
(when using the "developer tools" workaround), such actions became having the same bug,
out of nothing but just a few days of regular use. So, I have to switch to the other portable,
which is the one I'm using now with the workaround. I use both portable at the same time.
Reply all
Reply to author
Forward
0 new messages