Giter Site home page Giter Site logo

osaka's Introduction

Osaka - apple OSA script Kontrolling the Application (OSAKA :P) This is a Ruby library for automating work via GUI on Mac (using OSA/Applescript)

How to install

$ sudo gem install osaka

Note before use

You have to enable the “access for assistive devices” for the scripts to run. You do this via System Preferences -> Universal Access / Accessibility -> “enable access for assistive devices”

How to use

Examples:

#### Example: Using Osaka Flows to merge multiple keynote files.

require 'osaka'

# Convert all keynote files in dir "dirname" with the search pattern "pattern" and write it in "results.key"
CommonFlows.keynote_combine_files_from_directory_sorted("results.key", "dirname", /^\d+.*\.key$/)  

#### Example: Controlling Keynote

require 'osaka'

# Create a new application-specific wrapper
app = Osaka::Keynote.new

# Open a keynote file
app.open "presentation.key"

# Show a print dialog
dialog = app.print_dialog

# Save as PDF
dialog.save_as_pdf("presentation.pdf")

# Quit
app.quit

#### Example: Controlling Numbers

require 'osaka'

# Create a new application-specific wrapper
app = Osaka::Numbers.new

# Open a file
app.open "Numbers.numbers"

# Change a field
app.fill_cell(1, 4, "Hello World!")

# Save and quit
app.save
app.quit

#### Example: Using the lower-level remote control

require 'osaka'

# Create an application wrapper
calculator = Osaka::RemoteControl.new("Calculator")

# Start the application
calculator.activate
calculator.focus

# Control the calculator
calculator.click!(at.button("1").group(2))
calculator.click!(at.button("+").group(2))
calculator.click!(at.button("4").group(2))
calculator.click!(at.button("=").group(2))

calculator.quit

#### Example: Same as above using the Calculator class

require 'osaka'
calculator = Osaka::Calculator.new
calculator.activate
calculator.click("1")
calculator.click("+")
calculator.click("4")
calculator.click("=")
calculator.quit

API document: To be done.

Source code

github.com/basvodde/osaka

The license of this source is “BSD Licence”

Note on current version (0.4.0)

Current version is reasonably well tested on snow leopard, lion and mountain lion. It has been used to automate keynote, pages, and numbers work. Additional functionality would be useful but hasn’t been needed yet. If you do need additional functionality, please extend it and send me a pull request :)

Supported environments

1.9.x.

Author

Bas Vodde - basv AT odd-e.com

osaka's People

Contributors

basvodde avatar jwgrenning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osaka's Issues

Selecting files with TypicalOpenDialog

If the "view" is not "as list" but "as columns" then it will select the wrong file and it won't work.

(This is visible by changing the view to "as columns" and running the mail merge integration tests)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.