-1

Basically, for a project i'm thinking of making a macro recording application, with a gui. It doesn't have to be brilliant, just basically functional. Are there macro api's for java? Ideally i'd like to use java, its where most of my limited experience lies. If not then what other languages could be recommended?

I'm using linux myself and was alerted to the xMacro terminal app. what id like is the basic record/play of this with a gui. Any ideas?

confusified
  • 2,320
  • 7
  • 22
  • 29
  • So by "macro" you mean that you want to programmatically interact with the UI of some other program, right? – Joachim Sauer Aug 17 '11 at 11:40
  • Imagine a big shiny record button, when you hit that it records everything you do until you press {esc} for example. I could use this to record the action of opening antivirus and clicking the scan now option on antivirus. I could playback this macro to initiate a scan instead of having to manually open AV programs. – confusified Aug 17 '11 at 11:43
  • BDW i dont actually have antivirus on my linux machine, its just an example. I could make that and let my technologically illiterate family scan their windows machines without the effort :) – confusified Aug 17 '11 at 11:44

1 Answers1

1

For capturing actions outside the java application, you will need to use JNI, since Java doesn't supply the appropriate tools to do that. So you should consider doing that in another language.

MByD
  • 135,866
  • 28
  • 264
  • 277
  • +1: note that for *replaying* captured actions, Java *does* provide an API in the form of [the `Robot` class](http://download.oracle.com/javase/7/docs/api/java/awt/Robot.html). – Joachim Sauer Aug 17 '11 at 11:45
  • I'll look into JNI. What languages would be more appropriate? I'v seen the robot class mentioned, Its for playback, yes? how about recording? – confusified Aug 17 '11 at 11:45
  • the robot class is for playback, not recording. – MByD Aug 17 '11 at 11:47
  • So if i could come up with a manner of recording what the user does, and converting it into commands that robot could use.... does that sound reasonable? or am i way off the mark? – confusified Aug 17 '11 at 11:49
  • Yes, but I don't understand why would you want to mix languages? – MByD Aug 17 '11 at 11:51
  • @confusfied: that would be possible, but chances are that whatever you use to record the events also has a way to play them back and that going that way would be less problematic (no need to convert different "formats", ...). – Joachim Sauer Aug 17 '11 at 11:52
  • And nobody has any ideas of anything that has this record and playback functionality already? Even in other languages, im not bound to java. – confusified Aug 17 '11 at 11:54