3

Using a Greasemonkey script, would it be possible to create a script that would record and play back keyboard and mouse macros?

For example, I'd like to record the action of typing "JavaScript" on the Google Search homepage, and then clicking "Google Search", and then clicking "More" on the search results page. Then, I'd want to "play back" the macro that I had just recorded, simulating each of those events in sequence.

I'm not quite sure how to do this, though. I'm not even sure if it's possible in theory. Is it even possible to record and play back keyboard macros using JavaScript?

Anderson Green
  • 30,230
  • 67
  • 195
  • 328
  • I've found a blog post that may be relevant. It demonstrates recording and playing back a macro using JavaScript, but it appears that is uses AJAX as well as client-side JavaScript. http://pure.rednoize.com/movelogger/ – Anderson Green May 04 '13 at 01:27
  • Greasemonkey cannot script interactions with the browser's user-interface. You can script loading a search page and interacting with page elements. There are a variety of other tools for this (covered by other questions and sites like [su]). – Brock Adams May 04 '13 at 04:28
  • 1
    Apparently it's possible to [log events using JQuery](https://stackoverflow.com/questions/7439570/how-do-you-log-all-events-fired-by-an-element-in-jquery), so it may be possible to record macros in this way. – Anderson Green Nov 05 '19 at 17:29

0 Answers0