Run a Macro Hourly

How do I run a macro every hour, just before the start of the hour?

I searched and found:

you can run these manually or have the action performed regularly on an hourly basis or triggered by another program or script

However, I cannot find details on how to do this in the manual.

Okay, I found a page about using Windows Task Scheduler.
However, I created the Macro using the Chrome extension, and cannot find a .kmacro file for it. Can I use this macro, or do I have to create a new one in the desktop app for this to work?
I really want the macro to run hourly in Chrome, not in the built-in browser of the desktop app.

You can also run chrome macros from the command line.

I have not tried it with the task scheduler, but I expected this to work just fine. As command line you would use this:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "file:///D:/mytestcases/DemoAutofill1.html?direct=1&close=1&savelog=log1.txt"

It starts Chrome, loads the macro (as web page) and runs it.

2 Likes

Thanks Ulrich. Just, where do you get the HTML file from? The macro just appears to be a JSON file. Can the file be the page on the internet that I want to automate?

Edit: Oh wow! Yeah, that seems to work. Thanks Ulrich, you’re awesome!

Hello, i need to run a macro every 24 hours, i have read your post, but i am really newer in this tool, so i don´t know where can i put that command lines, i am really lost, I have the .html file, but i don´t know where to run it o where to program the task to run every 24 hours.
Would you help me please?

In my testing it’s best to have the task scheduler execute and run your macro from powershell. For some reason sometimes your can’t get focus on the browser and the XModule command won’t execute.

For example in task scheduler:
Start a program
Program/script: powershell.exe
Add arguments: -ExecutionPolicy Bypass -nologo -noprofile "C:\Pathtothescript\Yourscript.ps1"

Basic Powershell script to run your macro:
Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "file:///C:/Users/PathToYourAutoRunHTML/yourmacro.html?direct=1"
end

More info: How-to: Windows Task Scheduler, Automate RPA tasks

1 Like

You can use a simple batch file, it’s the simple and best solution to start kantu.

With timeout you set the delay.

Batch file do not need admin authorization of external software like powershell.

Hello,

This solution is working fine.

But I wonder how to do if I want to launch a windows batch script which run some json macro files, without launch ui.vision extension ?

I just want to run the webpage html and execute the json code into the macro files with a batch. Do you know how to do this please ?

Should I have to modify the code of the html webpage ? If yes, how to do to just launch the chrome an not to launch ui.vision ?

Thanks in advanced

Are you asking how to launch chrome only then just remove the "file:///… and UI.Vision won’t launch.

If you are asking how to launch a UI.Vision macro without UI.Vision then that won’t work because the macro needs UI.Vision obviously