MacOS
A library for interacting with your Mac through ruby.
Installation
gem install macos
Usage
Mouse
require 'macos'
mouse = MacOS.mouse
mouse.move(x: 0, y: 0)
position = mouse.position
puts "#{position.x},#{position.y}"
mouse.move(x: 2, y: 3)
position = mouse.position
puts "#{position.x},#{position.y}"
Display
require 'macos'
display = MacOS.display
bounds = display.bounds
puts "#{bounds.width}×#{bounds.height}"
display.screenshot do |tempfile|
# ...
end