LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I automate Linux similar to AutoHotKey and AutoIT? (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-automate-linux-similar-to-autohotkey-and-autoit-4175630878/)

enginestar 05-31-2018 06:56 AM

Can I automate Linux similar to AutoHotKey and AutoIT?
 
How can I automate using Linux similar to AutoHotkey andAutoIt.

I have a lot of experience using AutoHotKey.
It's awesome and powerful.
I can help automate and speed up mundane tasks.

This is the one biggest thing stopping me from moving to Linux.
If there was an alternative... then I'd jump much quicker to Linux.

Thanks.

pan64 05-31-2018 07:29 AM

in linux tasks are usually run without gui and automated by scripts. These [tools] are free and by default available. But if you have specific issue you need to give us more details...

AwesomeMachine 05-31-2018 08:02 AM

Yes, there are tools like those. https://github.com/Paris/IronAHK
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

DavidMcCann 05-31-2018 11:11 AM

I had to go to Wikipedia to answer your question - remember some of us have never had Windows! — but the answer is yes, but it's more do-it-your-self.

I have two scripts written in bash in my home directory. One, cleanup, is set to run after logging-in to remove things like flash cookies and ever-proliferating thumbnails. The other, backup, is included in the desktop menu and does exactly what it says.

You can also attach commands to keyboard shortcuts. Thus I have Super+1 set to
Code:

gconftool-2 string -s apps/panel/applets/clock/prefs/custom_format'<span> color="#ffffff"<b>%R %A %e %B</b></span>'
That reconfigures the panel clock to white type when I have dark wallpaper, while when I have a light desktop, Super+0 turns the clock black!

AwesomeMachine 05-31-2018 12:32 PM

To add to DavidMcCann's examples, I've written several shell scripts, and adapted others.

Remove all orphaned packages from the system.
Create a local distro repository.
Search and replace within groups of files
Automated television recording.
Set up firewall rules
Terminate groups of programs by keyword.
Compress/uncompress files by file name extension.
Back up files.

But many times there are programs written by others to perform common multi-step tasks. Windows doesn't require the same type of tools as Linux, because it's not used in the same way. Home users can take advantage of the vast array of system tools to either use alone or to build more complex tools using scripts.

BenTrabetere 05-31-2018 07:59 PM

AutoKey is a desktop automation utility for Linux that can be used for text substitution or to execute a script. It uses Python as the scripting language.

I primarily use it for text substitution, and I have keyboard shortcuts to perform mundane, repetitive tasks like entering my address, inserting accented and other special characters into a document, and inserting a 'Lorem ipsum' placeholder.

https://github.com/autokey/autokey

This is a review/tutorial for an earlier version of AutoKey. It will give you an idea about what it can do and how it can be used.
https://saravananthirumuruganathan.w...op-automation/

enginestar 06-04-2018 09:43 PM

thanks for the replies guys. i haven't had a chance to read replies until now.

none of the mentioned examples is what i need. :)

it's all about having a GUI and having a program that runs on top that simulates the EXACT actions you do in windows - like moving a mouse or navigation through options and outputting text. but then being able to add full programming simulation and looping behind it.

the stuff that you guys are talking about are much more advanced and for a higher intelligence species of mankind - that aren't used to being tortured by windows. LOL.

windows users have to suffer. so something like autohotkey really really helps. it lets windows be windows - but lets you automate different things.

let me give an example... i have a silly form that i have to fill in.
i have to fill in 10 fields. after the first 3 fields, i have to wait for the form to get new values for the rest of the form - this takes 5 - 30 seconds. i then have to fill out 7 other parts. one of which is a dropdown.

so i could make a script that outputs to the first 3 fields some predefined text. it then waits 30 seconds (or you can make it more intelligent and wait until the window is ready). you then fill out the next field. then send a tab command - so the browser tabs to the next field. you submit the next fields like this. on the drop down, you know you need the 15th item. so you simulate pressing enter and then pressing down 15 times and then press enter again and then press tab.

it's actually really powerful it does heck of a lot more than the above.

is thee ANYTHING like this on linux?

i was hoping IronAHK might be something worth looking at - but just saw a youtube video and it shows it's an advanced text substituion tool. i'll need to look into more. the guy onthe video does say that it can simulate mouse movement as well.

any further replies would be appreciated. thanks.

ondoho 06-05-2018 02:08 AM

Quote:

Originally Posted by enginestar (Post 5863747)
it's all about having a GUI and having a program that runs on top that simulates the EXACT actions you do in windows

http://linux.oneandoneis2.org/LNW.htm
;)

Quote:

windows users have to suffer. so something like autohotkey really really helps. it lets windows be windows - but lets you automate different things.
i think you just explained why an exact copy of autiohotkey does not exist for linux.
in any case, linux users do NOT have to suffer.
a large part of autohotkeys functionality is pointless in linux, because the functionality is right there under your nose, baked into the operating system.

enginestar 06-05-2018 07:55 AM

Quote:

Originally Posted by ondoho (Post 5863811)
i think you just explained why an exact copy of autiohotkey does not exist for linux.
in any case, linux users do NOT have to suffer.
a large part of autohotkeys functionality is pointless in linux, because the functionality is right there under your nose, baked into the operating system.

well... i'm just a complete newbiew to linux... but i have to disagree by giving an example.

take gimp.
change brightness, resize resolution and do a few other things.
doing these actions take a huge amount of time - say 20 seconds.
if you have 100 images you need to work on then this becomes a pain.
if you can write a quick script on the fly, then you save tons of time.
(gimp is awesome (especially the latest version) - but lacks so many simple short cuts to access things from menus)

OK... so you say you can code all of those things using something like imagemagick?
well say if i add... some pictures need editing and others don't you only know when you look at the image if it needs editing or not.
or maybe, when you look at the image, you immediately know to take actions xyz, else, use actions abc - in which case, you can code 2 scripts - one triggered by CTRL Q and the other by CTRL W (just making this up).

everything can be coded and an intelligent solution made - but this would take a lot of time.
with something like autohotkey, you can create solutions on the fly in just a minute or 2.

you can do for any program.

surely there HAS to be some sort of equivalent?

DavidMcCann 06-05-2018 10:41 AM

OK, lets take GIMP. Have you read the manual?
https://docs.gimp.org/en/gimp-scripting.html
That sounds like what you need.

The point here is to stop asking "what's the Linux program that's the same as XYZ in Windows?" and to start asking "how is this done in Linux?"

pan64 06-05-2018 01:15 PM

probably you can find something useful here: http://linux.oneandoneis2.org/LNW.htm

AwesomeMachine 06-05-2018 02:15 PM

Linux has different ways of automating tasks. You've been using autohotkey for a while, and you've adapted it to many different tasks. But there are many other ways on linux to automate work. And, in fact, Linux can do many things that are impossible on Windows.

enginestar 06-05-2018 05:35 PM

thanks for the replies guys.
i think you're missing the point. :)
autohotkey let's you create automation on top of windows programs where automation needs where never considered.

gimp automation tools are lacking. but i only used gimp as an example - it could be any other program.

i wish i wish there was something like autohotkey for mac. i would have been using macs for a long time if there was. i've been there and done that. they do have automation tools - but nothing that is anywhere near autohotkey. autohotkey is what i have used, but there is also one other that does the same thing.

i'll look into python. maybe this will offer a way to automate.

DavidMcCann 06-06-2018 09:40 AM

Quote:

Originally Posted by enginestar (Post 5864128)
gimp automation tools are lacking

Perhaps you could explain to us why you can't do whatever you want to with the scripting facilities provided, rather than just saying they're "lacking". Similarly, you keep saying how useful autohotkey is, which conveys nothing to those of us who've never seen it!

I think you'd do better to just stick with Windows. You like it and you know how to use it, so why change to something you don't seem happy to learn?

ondoho 06-06-2018 01:28 PM

no, we're not missing the point.

anyhow, here's one more: xdotool.
application independent.
for everything that sits on your desktop one way or anohter.
combine that with shell scripting etc., you can do so much more than you could ever imagine on any windows machine.


All times are GMT -5. The time now is 06:35 AM.