Hacker News new | past | comments | ask | show | jobs | submit login

OK, here's one for you. How would you automate a task in Firefox? Here's something I need to do often (to get around a bug in FF):

1. Press Ctrl P to get to the Print dialog 2. Scroll to "Print Using System Dialog" 3. Click on Page Setup. 4. Select 2 Pages per side. 5. Choose "Letter" for Paper Size 6. Click on "Print"

I can automate this using AHK on Windows. How would you do it on Linux? And how is running Firefox on Linux helping me any more than Windows?




I don't have an answer, but I've a question :P

How do you trigger the behavior? Is it bound to a key or is there a different way to trigger the action?

For example, I'm an emacs user and though I remember a lot of bindings, I also use heavily helm-M-x which provides fuzzy completion on command name.

For example, I may not remember all org-mode shortcuts, but I can do:

M-x org subtree

And I'll get a list of all org-mode commands on subtrees.

(I've never used AHK.)


> 1. Press Ctrl P to get to the Print dialog 2. Scroll to "Print Using System Dialog" 3. Click on Page Setup. 4. Select 2 Pages per side. 5. Choose "Letter" for Paper Size 6. Click on "Print"

How exactly does this work? Are you just sending a bunch of shortcuts? Or does autohotkey really understand when it reached "Print Using System Dialog" and which button has "Page Setup"?


You might just send all the expected commands in sequence and be fine, but that can be unreliable. Autohotkey can see the text contents of many dialogs and other windows components, which can be parsed and reacted too by the script. And it has functions for sending mouse clicks and keyboard commands, as well as directly editing controls, activating/minimizing/maximizing windows, etc. Unfortunately, I've found many more modern UI frameworks used in newer software have less that 'clues' that can be seen. But Autohotkey does have an image matching function that works well in a lot of cases when the traditional way fails.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: