Class: OSX
- Inherits:
-
Object
- Object
- OSX
- Defined in:
- lib/osx.rb
Class Method Summary collapse
- .[](app_name) ⇒ Object
- .desktop_height ⇒ Object
- .desktop_size ⇒ Object
- .desktop_width ⇒ Object
- .hide_everything ⇒ Object
- .open_location(*args) ⇒ Object
- .running_applications ⇒ Object
- .system_events ⇒ Object
Class Method Details
.[](app_name) ⇒ Object
15 16 17 |
# File 'lib/osx.rb', line 15 def [](app_name) system_events.application_processes[app_name] end |
.desktop_height ⇒ Object
31 32 33 |
# File 'lib/osx.rb', line 31 def desktop_height desktop_size[3] end |
.desktop_size ⇒ Object
23 24 25 |
# File 'lib/osx.rb', line 23 def desktop_size @desktop_size ||= Finder.desktop.window.bounds.get end |
.desktop_width ⇒ Object
27 28 29 |
# File 'lib/osx.rb', line 27 def desktop_width desktop_size[2] end |
.hide_everything ⇒ Object
3 4 5 |
# File 'lib/osx.rb', line 3 def hide_everything system_events.keystroke("h", :using => [ :command_down, :option_down ]) end |
.open_location(*args) ⇒ Object
7 8 9 |
# File 'lib/osx.rb', line 7 def open_location(*args) args.each { |url| system_events.open_location(url) } end |
.running_applications ⇒ Object
19 20 21 |
# File 'lib/osx.rb', line 19 def running_applications system_events.application_processes.get.collect { |a| a.name.get } end |
.system_events ⇒ Object
11 12 13 |
# File 'lib/osx.rb', line 11 def system_events @system_events ||= Appscript.app("System Events") end |