@yemreak/alfred5
v0.1.1
Published
Alfred5 workflow utility for typescript projects
Readme
alfred5
Overview
This TypeScript library facilitates the creation of responses for Alfred Workflows. It defines the structure for result items based on Alfred's JSON format and provides a function to output these results appropriately.
Usage
- Define Results: Create an array of
AlfredResultobjects, each representing an item in Alfred's search results. - Output Response: Use the
responsefunction to output the JSON formatted results for Alfred to process.
Types
AlfredResult: Represents an individual result item with optional fields for UID, type, subtitle, and more.response: Function that takes an array ofAlfredResultand outputs the correct JSON format for Alfred.
Example
import { response } from './path_to_this_module';
const results = [
{
uid: 'example',
title: 'Example',
subtitle: 'This is an example',
arg: '/path/to/action',
icon: {
type: 'fileicon',
path: '~/Desktop'
},
valid: true
}
];
response(...results);More Information
For more details on Alfred's JSON format for script filters, visit Alfred's documentation.
