workflow-osx

a "Desktop Workflow" monad with Objective-C bindings

https://github.com/sboosali/workflow-osx#readme

Latest on Hackage:0.0.1

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

GPL-3.0-only licensed by Spiros Boosalis
Maintained by [email protected]

a "Desktop Workflow" monad with Objective-C bindings.

includes bindings to:

  • press keys with modifiers

  • get/set the clipboard

  • launch/focus applications

  • get the name of the current application

  • open URLs

for example:

-- | cut the currently highlighted region
cut :: (MonadWorkflow m) => m String
cut = do
 sendKeyChord [CommandModifier] XKey
 delay 250
 getClipboard
-- | transform the currently highlighted region, via the clipboard
transformClipboard :: (MonadWorkflow m) => (String -> String) -> m ()
transformClipboard f = do
 contents <- cut
 setClipboard (f contents)
 sendKeyChord [CommandModifier] VKey

see Workflow.OSX for several more examples

(if hackage won't build the docs, see them at http://sboosali.github.io/documentation/workflow-osx/index.html)

(this package is on hackage for convenience, but it's still a prerelease)