GithubHelp home page GithubHelp logo

neil-hyd / sushihangover.applescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sushihangover/sushihangover.applescript

0.0 0.0 0.0 20 KB

An OS-X AppleScript C# library - Call AppleScript Function with Arguments and get Return value

License: MIT License

C# 45.13% Objective-C 53.44% Makefile 1.43%

sushihangover.applescript's Introduction

Sushi.AppleScript

https://github.com/sushihangover/SushiHangover.AppleScript.git

The C# library allows you to execute AppleScript code that originates from a file or string and:

  • Call function by name (Optional)
  • Pass multiple arguments to a function (Optional)
  • Execution success or failure
  • Return results from the function call

Build:

cd SushiHangover.AppleScript.Native
xcodebuild
cd -
nuget restore
xbuild SushiHangover.AppleScript.sln

Note:

AppleScript.cs(7,7): error CS0246: The type or namespace name `MonoMac' could not be found. Are you missing an assembly reference?

If you do not have a local copy of MonoMac, xbuild will fail. It is available via "Xamarin Studio" so you can biuld from the cmd line via:

mdtool build SushiHangover.AppleScript.sln

Test:

Mono's supplied nunit-console:

MONO_IOMAP=all nunit-console SushiHangover.AppleScript.Test/SushiHangover.AppleScript.Test.csproj

NUnit 3.x console:

mono $(MTOOLS)/nunit3-console.exe SushiHangover.AppleScript.Test/SushiHangover.AppleScript.Test.csproj

####Example Usage:

var scptInfo = new FileInfo ("./AppleScripts/FunctionTests.txt");
string funcName = "IsRunning";
List<string> argList = new List<string> () {
	@"Finder",
};
string scriptReturnValue;
var executionSuccess = AppleScript.Run (scptInfo, funcName, argList, out scriptReturnValue);
  • Consult Test.cs for more examples

###Supports:

  • MonoMac
  • Xamarin.Mac
  • i386 and x86_64 Mono Support

###Runtime/Deployment debugging:

Runtime/Deployment debugging available by setting an environment variable, APPLE_SCRIPT_DEBUG:

export APPLE_SCRIPT_DEBUG=true

The results are logged with the prefix AppleScript:, output is avaiable via Console.app.

###SushiHangover.AppleScript

The C# library that provides the P/Invoke wrapper to execute AppleScript functions

###SushiHangover.AppleScript.Native

An OS-X Universial (i386 & x86_64) Shared Library:

  • libAppleScriptEvent.dylib

###SushiHangover.AppleScript.Test

NUnit tests for Sushi.AppleScript library

###SushiHangover.AppleScript.CLI

TODO: Provides an osascript style CLI utility to execute functions with AppleScript files (osascript does not contain this feature)

###License:

  • The MIT License (MIT)

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.