Alfred Workflow Script Manager written in Deno

Alfred Workflow Script Manager written in Deno

I wrote this using Deno to experiment with Deno and improve a workflow I wrote for myself for Alfred.

Alfred IO

I wrote this using Deno to experiment with Deno and improve a workflow I wrote for myself for Alfred.

The basic idea:

  • In code configure your various sub-tasks
  • In Alfred, point to your script for querying and for executing
  • Use Alfred

Usage

This isn't currently in any kind of package management because it felt overkill for what I needed at this point. So steps to running are like so:

  • Install Alfred
  • Install Deno
  • Pull this code
  • Author your Alfred items in code
  • Point Alfred workflow at your code
  • Execute your query

Authoring Alfred Items

I recommend having a bin dir in your Home directory. In there you might add something like this:

import { Parser, ItemHandler } from "../Code/alfredio/alfredio.ts";

const items = [new ItemHandler({
    uid: "jonphenow.alfred.gh",
    type: "default",
    title: "Open My GitHub",
    autocomplete: "github",
    arg: "github",

    action: ["open", "https://github.com/jphenow"],
    matcher: (query) => {
        if (query.length === 0) { return true; }

        const [subcommand] = query;
        return "github".startsWith(subcommand);
    }
})];

Parser.process(items, Deno.args.slice(1));

For more information on the format of the AlfredItems see the interface and the Alfred Docs

Point Alfred workflow at your code

  • In Alfred Preferences, create a new workflow
  • Right-click on the workflow area and select Inputs > Script Filter
    • Set a keyword like jp
    • ✅ With space
    • Argument Optional

Now for the most important part. In the script area:

/usr/local/bin/deno --allow-all "path/to/your/alfred/config/from/above.ts" query [email protected]

Save the Script filter then grab the little nub sticking out and drag it.

  • Select Actions > Run Script
  • /bin/bash
  • with input as arv

Then in the script:

/usr/local/bin/deno --allow-all "path/to/your/alfred/config/from/above.ts" execute [email protected]

Execute your query

At this point you should be able to open Alfred and use your Alfred items.

If you have issues, from the Alfred Workflow, select the bug in the top-right to see any log or error output.

Download Details:

Author: jphenow

Source Code: https://github.com/jphenow/alfredio

deno nodejs node javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

AEM Querybuilder for JavaScript (Browser, Node, Deno)

Helix Querybuilder .AEM Querybuilder for JavaScript (Browser, Node, Deno)

NKeys for JavaScript - Node.js, Browsers, and Deno

A public-key signature system based on Ed25519 for the NATS ecosystem system for JavaScript. The nkeys.js library works in Deno, Node.js, and the browser!

Javascript module for easily generating mazes,compatible with both Deno and Node

A work-in-progress Javascript maze generator module, compatible with both Deno and Node.

Deno Tutorial for Beginners: Deno vs. Node: Better Than NodeJS?

Deno is released, it’s time to find out if it can prove a worthy competition for Node.js. What is Deno? Why Deno can be considered an alternative to Node? The main differences between Deno and Node. Write a simple Deno app.

What is Deno? The Node.JS Killer? The Deno-minator to Node?

What is Deno? The Node.JS Killer? The Deno-minator to Node? Deno is the new hype and will it be better than node.js? Deno is a secure runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language that addresses Node’s shortcomings