开发者

What are the alternative(s) to applescript in Linux? How are they different?

开发者 https://www.devze.com 2023-04-11 01:22 出处:网络
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

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消