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 post
  • deanishe changed the title to Run macOS Services
Posted (edited)
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 post
15 minutes ago, deanishe said:

So it works with types other than plaintext, basically.

 

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

Link to post
Posted (edited)
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 post

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 post
9 hours ago, deanishe said:

Are you asking why the workflow also shows disabled services? It's because I haven't found the list of enabled ones yet.

Ah I see, It isn't showing any of the other disabled services just those 4, but makes sense. 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...