Skip to content

Stvad/kotlin-alfred-workflow-template

Repository files navigation

kotlin-alfred-workflow-template

A template for creating Alfred workflows with KotlinJS

Actually useful workflow I've built using this: https://github.com/Stvad/FuzzyDate

How to use the template:

  1. Clone this repository

  2. Build it via ./gradlew build

  3. Add symlink from Alfred workflow directory to the workflow_resources directory

    • You can find out the Alfred workflow directory by righ-clicking any of the workflows you have and choosing Open in Finder/Terminal

  4. At this point you should have a fully functional workflow that you can invoke via this keyword. It'd append Is Awesome to your input and would allow you to copy the result to clipboard or paste it into the frontmost application

  5. Now you can edit the workflow settings/details directly in Alfred

  6. The core workflow logic is located in the example_workflow.kt file. Change it to build your own workflow.

    Other points of interest:

    • AlfredResult data class that represents an one item of results to be returned to Alfred
    • This template is using alfy library to abstract the details of communicating with Alfred. And to simplify publishing resulting workflow to NPM.

Publishing workflow to NPM

  1. Create and log into npm account
  2. Give the workflow a different name 😉
  3. Build it
  4. Go to the build/js/packages/<package name> and run npm publish

This workflow in NPM

npm install -g kotlin-alfred-workflow-template

About

A template for creating Alfred Workflows with KotlinJS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages