applescript 0.0.8 copy "applescript: ^0.0.8" to clipboard
applescript: ^0.0.8 copied to clipboard

Dart 1 only

A library for executing AppleScript in Dart.

example/applescript.dart

// Copyright (c) 2014, Christopher Su. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library applescript.example;

import 'package:applescript/applescript.dart';
import 'dart:io'; // required for results callback

main() {
  // Example
  AppleScript as = new AppleScript('tell application "Spotify" to playpause');
  as.run();
  
  // Example with Results Callback
  printResults(ProcessResult results) {
    print(results.stdout);
  }
  
  AppleScript as2 = new AppleScript.results('do shell script "echo Hello World"', printResults);
  as2.run();
  
  // Empty constructor
  AppleScript as3 = new AppleScript.empty();
  as3.script = 'tell application "Spotify" to set sound volume to (sound volume + 10)';
  as3.run();
}
0
likes
25
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

A library for executing AppleScript in Dart.

Homepage

Documentation

Documentation

License

BSD-3-Clause (license)

More

Packages that depend on applescript