Skip to main content

Alfred Workflow Script Filter power tool..

Project description

Documentation Status https://github.com/MacHu-GWU/afwf-project/workflows/CI/badge.svg https://codecov.io/gh/MacHu-GWU/afwf-project/branch/master/graph/badge.svg https://img.shields.io/pypi/v/afwf.svg https://img.shields.io/pypi/l/afwf.svg https://img.shields.io/pypi/pyversions/afwf.svg https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social
https://img.shields.io/badge/Link-Document-blue.svg https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Source_Code-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to afwf Documentation

Alfred Workflow Script Filter power tool.

Install

afwf is released on PyPI, so all you need is:

$ pip install afwf

To upgrade to latest version:

$ pip install --upgrade afwf

最佳实践中, Script Filter 的设置应该是这样的:

  • with space: checked

  • Language: /bin/bash

  • with input as {query}

  • run behavior:
    • Queue Mode: Terminate previous script

    • Queue Delay: Immediately after each character typed

    • Always run immediately for first typed arg character: checked

    • Argument: Automatically trim irrelevant arg whitespaces

    • Don’t set argv when query is empty: unchecked

  • Escaping: double quotes, backslashes

然后 Script 里这么写:

/path/to/python main.py 'handler_id {query}'

handler_id 是一个字符串, 唯一对应一个 python “handler” 函数. 所谓 “handler” 就是一个 python 函数, 接受一个 ‘{query}’ 的字符串输入, 创建一个 Workflow 对象, 返回一些 Item.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

afwf-0.0.3.tar.gz (35.3 kB view hashes)

Uploaded Source

Built Distribution

afwf-0.0.3-py2.py3-none-any.whl (40.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page