Giter VIP home page Giter VIP logo

libreautomate's Introduction

LibreAutomate C#

C# script editor and automation library for Windows.

Some features of the automation library:

  • Automate desktop and web UI using keys, mouse and API. Find and click buttons, links, images.
  • Launch programs. Manage files and windows. Transfer and process text and other data.
  • Hotkeys, autotext and other triggers. Auto-replace/expand text when typing. Auto-close windows. Remap keys.
  • Custom toolbars that can be attached to windows or screen edges. And menus.
  • Custom dialog windows of any complexity can be created easily in code.
  • All classes/functions are documented.
  • The library can be used in other programs too. More info.
  • Uses .NET 8.

Some features of the script editor program:

  • The scripting language is C#. The program is a good way to learn it.
  • C# code editor with intellisense. Script manager, cookbook, debugger.
  • Tools for recording keyboard/mouse and selecting UI objects such as buttons, links and images.
  • Also you can use .NET and other libraries. Tools and databases for NuGet, Windows API, icons.
  • Can create independent .exe programs and .NET libraries.

More info and download: https://www.libreautomate.com/

Editor window

window

How to build

Need Visual Studio 2022 with C#, C++, .NET 8 SDK and Windows 10 or 11 SDK. Need 64-bit Windows 10 or 11.

  1. Download and extract. Or git clone.
  2. Open Au.sln in Visual Studio.
  3. Build solution (not just the startup project).
  4. Switch to platform x86, build solution, switch back to AnyCPU.
  5. Run Au.Editor project. It should open the editor window.

libreautomate's People

Contributors

fillip74 avatar qgindi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libreautomate's Issues

Disable Triggers Bug

If you disable triggers from the tray icon before the main window being create it will crash;

How to get all AutoComplete texts from a Textbox?

I'm trying to automate quite old software (win32) and I can't get the items inside the textbox (AutoComplete)
https://youtu.be/xRf0Q5gmxlE
The video above shows what the textbox looks like
As shown in the video, I search for "prazo" and press ENTER.
A list of all items containing the word "prazo" appears.
The software does a SELECT on the database every time I press ENTER and it shows the items in the textbox (AutoComplete).
I can scroll through all items with the DOWN key.
But this sometimes causes problems, so I would like to get all the items without having to go item by item.
Could you help me how to get these items?

NuGet package update

Hello, how are you?
Could you please update the package on NuGet?
The currently available version on NuGet is 13.0.
Can you update to version 16.0?
Thank you!

Find an element more easily

Good Morning!
I'm learning to use LibreAutomate.
I have a problem with my code!
The app I want to manipulate doesn't have locators.
The only way I found to locate these elements was with the code below:
Is there an easier way to do this?
Because I have to keep writing this manually: ch1, ch2...

var w = wnd.find(-5, "CP-Pro Mais", "TfrmCProc");
if (w.Is0)
{
    MessageBox.Show("Window not found");
}

var e = w.Elm["CLIENT", "CP-Pro Mais", navig: "ch5 ch1 ch1 ch1 ch2 ch1 ch3 ch1 ch1 ch1 ch3 ch1 ch3 ch1 ch3 ch1"].Find(-5);

if (e is null)
{
    MessageBox.Show("Element not found");
}

e?.MouseClickD();

the problem about action on java application

hello Qmgindi, nice to see you, i'm investigating about the java access bridge for automating the java application. but now i stuck at how to double click, right click ... various action on a element.
have you any suggest for me? thank you very much.

Is there a way to replace the text of a control?

My control doesn't support "CTRL+A"
Is there another way to clear the control?
In AutoIt, when I go to set a text to the control, it automatically clears before pasting the text
Is there something similar in LibreAutomate?

Your project is really good man, I'm addicted to it.
Keep it up.
Thanks!

Popup Stuck

Hi, when using the app if you open the Parameters Info or AutoCompletion popup and minimize the app window, the popup will stuck on the screen when you open the app.

How to find one element inside the other?

I have the following code:

var w = wnd.find(-5, "CP-Pro Mais", "TfrmCProc");
var e = w.Elm["WINDOW", prop: "class=TfrmAcompanhamento"].Find(-5);
var f = e.Elm["BUTTON", "Incluir", "class=TPLKButton"].Find(-5);
f.MouseClick();

the "F" element is inside the "E" element
What's the correct way to do this?

Bold font bug

Hello, after the last update, when you uncheck the Bold value in the font settings for the 'Function', it will revert to Bold after restarting the application.

dialog: kbd accelerators don't work when cursor is on edit field

in the following dialog the accelerators (like Alt+E to select "Essen") do not work when the dialog has an edit field and the cursor is positioned in it. Those key combinations do not interfer with editing, so it would be great if they would work😉

        var d = new dialog(buttons:"OK|Cancel");
        string[] myopts = { "&Frankfurt","&Berlin","&Essen","&London","Bre&men","F&riedrichshafen"};
	string rb = ""; //( radiobuttons
	for(int i = 0;i < myopts.Length;i++)
	{
			rb += (i.ToS()) + " " + myopts[i]+"|";
	}
	rb = rb.Substring(0, rb.Length - 1);
				
	d.SetRadioButtons(rb);
	d.SetEditControl(DEdit.Text);
	d.SetText("Enter your name and select your favorite city");
	d.ShowDialog();

Possible support for Java UI in the future?

Hello budy, how are you?
Do you think Java UI support would be possible in the future?
If not, do you know of any alternatives to deal with this problem?
I need to fill a textbox in a java application, but LibreAutomate cannot capture the element, only the window.
Thanks!!!

Au.Editor Compile Error

Severity Code Description Project File Line Suppression State
Error "E:\ZZGit\LibreAutomate_\dotnet_ref_editor.txt" does not exist Au.Editor E:\ZZGit\LibreAutomate\Au.Editor\EXEC 1
Severity Code Description Project File Line Suppression State
Error "E:\ZZGit\LibreAutomate_\dotnet_ref_editor.txt" does not exist Au.Editor E:\ZZGit\LibreAutomate\Au.Editor\EXEC 1
Severity Code Description Project File Line Suppression State
Error C1010 unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? Cpp C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\modules\std.ixx 147

Variable out of Scope From C# Cookbook Tutorial

The below example occurs when the var 'two' is refernced in the print.it() method even though the
example says it should work....

Example from: Cookbook --> C# Language --> Variables, fields, built-in types

int one = 10, two, three = one, four = i;
print.it(one, two, three, four);

Compilation: 1 errors
error CS0165: Use of unassigned local variable 'two'

image

CPP Compile Error

Severity Code Description Project File Line Suppression State
Error C1010 unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? Cpp C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\modules\std.ixx 147

CPP Compile Error

Severity Code Description Project File Line Suppression State
Error C1010 unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? Cpp C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\modules\std.ixx 147

How does this compare to Autohotkey?

Using a standard language like C# for writing scripts will attract many users, but how powerful is the keyboard remapping functionality compared to Autohotkey?

This author has taken a different approach by encapsulating Autohotkey in Python: ahk

Is it possible to make my automation asynchronous?

Good morning my friend!
I have the following code:

private async void btn_Teste1_Click(object sender, EventArgs e)
{
    await LibreAutomateService.Teste();
}

public static async Task Teste()
{
    var r = await Task.Run(() =>
    {
        var w = wnd.find(3, "Mex Benefícios Tools v1.7.4 beta", ".Window.");
        var e = w.Elm["BUTTON", "ENTRAR", "id=btn_Entrar"].Find(-5);
        if (e == null) { print.it("not found"); }
        e?.MouseClick();
        return true;
    });
}

An error is happening:
Au.Types.NotFoundException: 'Not found.'

When the method is synchronous, it works
What am I doing wrong?

NullReferenceException when using ifRunning

Hi, when trying to end a script with the property 'ifRunning end' using a hotkey trigger without opening the main window once will result in a NullReferenceException.

Warning: System.NullReferenceException: Object reference not set to an instance of an object.
   at RunningTask.End(Boolean onProgramExit)
   at RunningTasks.RunCompiled(FileNode f, CompResults r, String[] args, Boolean noDefer, String wrPipeName, Boolean ignoreLimits, Boolean runFromEditor, Func`2 debugAttach)
   at CompileRun.CompileAndRun(Boolean run, FileNode f, String[] args, Boolean noDefer, String wrPipeName, Boolean runFromEditor, Nullable`1 ifRunning, Func`2 debugAttach)
   at CommandLine.<_WmCopyData>g___RunScript|15_0(<>c__DisplayClass15_0&)
   at CommandLine._WmCopyData(IntPtr wparam, IntPtr lparam)
   at CommandLine._WndProc(wnd w, Int32 message, IntPtr wparam, IntPtr lparam)

Suggestions: generating a Dash docset & adding ASP.NET access to LibreAutomate

Hello,
I got some suggestions for LibreAutomate but first I want to explain what Dash docsets are.

Dash docsets

Dash docsets are a form fully offline documentation dumps in .tgz format (.tar.gz) that are made for example with HTTrack, then all remote links are turned into local ones.

If needed, Javascript cans be stripped and some CSS files removed.

Afterwards a table of contents, with function names, classes, etc is manually created.

It will actually behave as a bookmark list that jumps to the correct offline HTML page for the clicked item in the table of contents.

It's also useful for searching functions, classes & more in a single search bar, and getting all the matched results.

Dash docset viewers

Right now I know of only two docset viewers by the same developers (one is open-source, the other is commercial).

Docset for the LibreAutomate API

I noticed that your project already has a DocFX documentation for the API & guides.

Could it be possible for you to find a way to convert DocFX to a Dash docset?

This way we could be able to point a Dash docset viewer to a single link that refers to a .tgz file and your LibreAutomate reference would be available fully offline in a native documentation viewer.

Example of a Dash docset link for a single language/docset:

<entry>
	<name>AutoIt</name>
	<version>3.3.14.0</version>
	<url>https://kapeli.com/feeds/zzz/user_contributed/build/AutoIt/AutoIt.tgz</url>
	<url>https://sanfrancisco.kapeli.com/feeds/zzz/user_contributed/build/AutoIt/AutoIt.tgz</url>
	<url>https://newyork.kapeli.com/feeds/zzz/user_contributed/build/AutoIt/AutoIt.tgz</url>
	<url>https://london.kapeli.com/feeds/zzz/user_contributed/build/AutoIt/AutoIt.tgz</url>
	<url>https://frankfurt.kapeli.com/feeds/zzz/user_contributed/build/AutoIt/AutoIt.tgz</url>
	<other-versions/>
</entry>

ASP.NET access

That one isn't of high priority in my list but it could be interesting.

If this was possible, perhaps having a new compiler output type of 'ASP.NET DLL' could generate a dummy DLL file that loads Au.dll, then AuCpp.dll.

Then the LibreAutomate API would more easily expose the ASP.NET CGI environment to a C# script.
That includes reading STDIN, outputting the HTTP response to STDOUT, reading environment variables etc.

There could be help on how to build the needed ASPX webpage & the web.config file, or LibreAutomate could generate good generic ones at compile time.

It would be a sort of PHP-like environment where global constants such as a _SERVER_NAME string, _HTTP_HEADERS string array & e.g. _QUERY_STRING string array & _REQUEST_BODY byte array could be exposed.

Could be useful for creating local HTTP APIs that need the help of native code.

I don't think that I will myself use this feature is implemented, not now, but it cans prove very useful later.

That's it for my suggestions (for now),
Thanks

Java Access Bridge does not work

Can you help me please?
I formatted my PC and now I can no longer activate the "Java Access Bridge".
Now the "Java" option in Options > OS is disabled.
Do you know why this is?

Captura de tela 2024-06-24 175523

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.