cage1016 / ak

A generator for golang alfred workflow that helps you create boilerplate code.
https://kaichu.io/posts/golang-alfred-workflow-generator-ak/
MIT License
9 stars 0 forks source link

Configure Workflow empty #1

Closed AjayShanker-geek closed 1 year ago

AjayShanker-geek commented 1 year ago

Hi, I am currently learning go on my free time and wanted to create plugins for alfred. For now I am running a simple test from awgo.

package main

import (
    aw "github.com/deanishe/awgo"
    _ "github.com/joho/godotenv/autoload"
)

// Workflow is the main API
var wf *aw.Workflow

func init() {
    // Create a new Workflow using default settings.
    // Critical settings are provided by Alfred via environment variables,
    // so this *will* die in flames if not run in an Alfred-like environment.
    wf = aw.New()
}

// Your workflow starts here
func run() {
    // Add a "Script Filter" result
    wf.NewItem("First result!")
    // Send results to Alfred
    wf.SendFeedback()
}

func main() {
    // Wrap your entry point with Run() to catch and log panics and
    // show an error in Alfred instead of silently dying
    wf.Run(run)
}

After that, run build and pack command, but the comes out empty. Am I doing something wrong?

AjayShanker-geek commented 1 year ago

I found out that I have to still create script filter in the workflow and pass in the value.