Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

motion-macos-screenshothelper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion-macos-screenshothelper

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

motion-macos-screenshothelper

A gem for taking automated screenshots in macOS applications written in Rubymotion.

Installation

Add this line to your application's Gemfile:

gem 'motion-macos-screenshothelper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install motion-macos-screenshothelper

Usage

Add the ScreenshotHelper tool to your spec files like so:

describe 'My application' do
  before do
    @app = NSApplication.sharedApplication
    @sh = Motion::ScreenshotHelper.new(my_config)
  end

  it 'takes a screenshot' do
    @sh.shoot.should == true
  end

  it 'takes a screenshot after waiting' do
  	# do something import with your GUI
  	@sh.pause(1.0) # time in seconds to wait
	@sh.shoot.should == true
  end
end

You may set the following config options when calling ```Motion::ScreenshotHelper.new`:

my_config = {
      screenshot_mode: Motion::ScreenshotHelper::SCREENSHOT_MODE_FULLSCREEN, # for full-screenshots
      shots_dir: 'screenshots', # the target dir for the screenshot files
      file_basename: 'screenshot', # the basename for the screenshot files (a counter will be added) e.g. 'screenshot_0.png'
      app_name: NSBundle.mainBundle.infoDictionary['CFBundleName'] # your application name needed for focusing the app with AppleScript
}

ScreenshotHelper will make use of the screencapture command line tool.

Contact

https://vt-learn.de

FAQs

Package last updated on 04 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc