@hackage workflow-osx0.0.1

a "Desktop Workflow" monad with Objective-C bindings

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)