module Moodswings::Platform::OSX

Public Instance Methods

close_app(app_name) click to toggle source
# File lib/moodswings/platform/osx.rb, line 26
def close_app(app_name)
  system(
    "osascript " \
    "-e \'tell application \"#{app_name}\"\' " \
    "-e \'quit\' " \
    "-e \'end tell\'"
  )
end
desktop_background(filepath) click to toggle source
# File lib/moodswings/platform/osx.rb, line 7
def desktop_background(filepath)
  path = File.expand_path(filepath)
  system(
    "osascript " \
    "-e \'tell application \"Finder\"\' " \
    "-e \'set the desktop picture to POSIX file \"#{path}\"\' " \
    "-e \'end tell \'"
  )
end
open_app(app_name) click to toggle source
# File lib/moodswings/platform/osx.rb, line 17
def open_app(app_name)
  system(
    "osascript " \
    "-e \'tell application \"#{app_name}\"\' " \
    "-e \'activate\' " \
    "-e \'end tell\'"
  )
end