Jump to content

Recommended Posts

Run macOS services from Alfred…

 

  • on the current selection
  • on the clipboard contents

  • on files via a File Action
     

Installation

 

Download the latest version from GitHub and double-click to install.

 

Usage

 

  • Use keyword services to run a service on the current contents of the clipboard.
  • Configure the included Hotkeys to run a service on the current selection or clipboard contents.
  • Use the macOS Services File Action to run on selected files in Alfred.


For more info, see the README on GitHub.

 

Edited by deanishe
Link to comment
  • deanishe changed the title to Run macOS Services
32 minutes ago, vitor said:

Typo

 

Thanks.

 

32 minutes ago, vitor said:

I’m curious as to why you’re faking ⌘C plus a delay instead of using Argument: Selection in macOS on the Hotkey Trigger.

 

So it works with types other than plaintext, basically.

 

You execute a service by passing its name and a pasteboard to NSPerformService(), so the input has to be on a pasteboard in any case.

 

The workflow just reads the types of data on the pasteboard, and shows you a list of your services that understand one or more of those types (except when you use the File Action, which also puts the files on the pasteboard). After that, it calls the API with the service and pasteboard.

Edited by deanishe
Link to comment
12 minutes ago, vitor said:

 

I see. I hadn’t given a thought as to how Alfred extracts Selection in macOS. Thank you for the explanation.

 

I'm pretty sure Alfred simulates ⌘C. But it instantly restores the previous clipboard contents, so "Selection in macOS" is a really poor fit for this particular workflow.

 

The workflow could perhaps be smarter about using the clipboard (i.e. monitor it for changes), but I couldn't be bothered, tbh.

Edited by deanishe
Link to comment

This looks great, I don't user services much but I will prob start now that I can invoke it from Alfred?

 

Question it alway shows all of my enabled services from the keyboard menu bu both convert text to traditional chinese, convert text to half width and add music as spoken track always so up for both selected text and file actions even tho they are disabled. 

 

Any idea how to flush the library its pulling from or clear the services cache? 

Link to comment
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...