Effectively, I am looking for an AutoIt clone for Linux.
I am aware of tools like Sikuli, Javaauto, etc, but they just won't cut it, because they rely on x, y coordinates and for example they are unable to find a window or menu item based on its title text.
I want something that I can find the window based on its title, or be able to click the button labelled 'OK'.
I have Googled and I have checked out this SuperUser question and this five year old S.o question - from which I shall now proceed to shamelessly copy large parts, as the OP @Xeddy made such a good job of stating the requirements.
Here’s a simple, sample script:
Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Save") Send("!n")
Run the script and you'll see Notepad open, some text appear and then close.
Now the above example, although a bit pointless, is a demo of the sort of functionality and simplicity I'm looking for. Here's an explanation for those who don't speak AutoIt:
----Start of Explanation of Code ----
Asks user to input some text and stores it in varInput Runs notepad.exe Waits till window exists and is active Sends the contents of varInput as a series of keystrokes Sends keystrokes to go to File -> Exit Waits till the "Save" window is active Sends some more keystrokes Shows a Message Box with some text and the contents of a variable Registers a hotkey, Win+N, which when pressed executes notepad.exe
----End of Explanation----
So as you can understand, the features are quite obvious: Ability to easily simulate keyboard and mouse functions, read input, process and display output, execute programs, manipulate windows, register hotkeys, etc.. all being done without requiring any #includes, unnecessary brackets, class declarations etc. In short: Simple.
Perhaps the single greatest thing about AutoIt, which all others seem to lack is that it does not rely on x,y coordinates - one can search for a window by title (even wait for it to appear).
Plus AutoIt uses a Basic-like scripting language, with normal programming concepts like IF statements, loops, etc
Is there anything quite so powerful for Linux?