I'm preparing to switch to Linux. I want to learn more about what Linux users do to solve problems that OSX users solve with Applescript. More specifically: What are they called? How are they different?
-
4This question, as-is, is too vague. What kind of problems? This is also basically the same (vague) question you asked about BSD.– JoeOct 4, 2011 at 1:05
-
2The problem with this question is: Most linux users won't know what an apple script is. Give me a specific purpose and I can tell you which language I'd use in Linux...– DennisOct 4, 2011 at 1:06
-
2I appreciate your feedback; (1) I'm leaning towards ubuntu but I'm also interested in BSD; (2) the question's intended for people who know how applescript is used, as such, I'm not sure it's too vague -- obviously, users and moderators decide.– user912475Oct 4, 2011 at 1:11
-
4your question is much too vague -- what are you trying to do?– TiloOct 4, 2011 at 1:30
-
They are not alternatives.– Nicolas BarbulescoMay 7, 2014 at 22:33
3 Answers
Many Linux applications provide basic UI interactions from the command-line.
For those that don't do quite what you'd like you might try some UI automation tools such as:
- strongwind or dogtail -- accessibility based UI automation
- Xpresser or Sikuli -- screen recognition based UI automation
I am assuming you're using applescript for basic system automation. There are a wide variety of languages available, but none as closely/uniformly integrated with the windowing environment/applications as applescript on OS X. You might find certain applications have scripting environments available for a certain language. In general, for basic automation, you'd do fine with any shell scripting language of your choice (bash, tcsh, ...). Since those same languages are also available on OS X, you might try working with them in that environment first. Be sure to check out the manual pages for the various programs you wish to automate, to find out what command-line parameters you need to use to get the behavior you want.
xdotool
As the previous commenters wrote, I'm not sure what you're trying to do. But for the problems I was trying to solve (1. moving the mouse 2. automating keypresses), I found xdotool here. Most of the details are covered there, but here's how to get started (all copied from the other site):
Installation of Xdotool on Linux
For Ubuntu, Debian or Linux Mint, you can just do:
sudo apt-get install xdotool
For Fedora, use yum command:
sudo yum install xdotool
For CentOS user, the package is available in EPEL repo. After enabling EPEL repo, simply use yum command as above.
For Arch user, the package is available in the Community repo:
sudo pacman -S xdotool
If you cannot find xdotool for your distribution, you can always download it from the official website.