deanishe Posted August 30, 2020 Share Posted August 30, 2020 (edited) 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 August 30, 2020 by deanishe lycopodiopsida, Chris Messina, nikivi and 2 others 4 1 Link to comment
vitor Posted August 30, 2020 Share Posted August 30, 2020 Typo: 1 hour ago, deanishe said: on the current selection on the current selection I’m curious as to why you’re faking ⌘C plus a delay instead of using Argument: Selection in macOS on the Hotkey Trigger. deanishe 1 Link to comment
deanishe Posted August 30, 2020 Author Share Posted August 30, 2020 (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 August 30, 2020 by deanishe vitor 1 Link to comment
vitor Posted August 30, 2020 Share Posted August 30, 2020 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 comment
deanishe Posted August 30, 2020 Author Share Posted August 30, 2020 (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 August 30, 2020 by deanishe Link to comment
Bemawr Posted September 2, 2020 Share Posted September 2, 2020 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
deanishe Posted September 2, 2020 Author Share Posted September 2, 2020 Are you asking why the workflow also shows disabled services? It's because I haven't found the list of enabled ones yet. Link to comment
Bemawr Posted September 2, 2020 Share Posted September 2, 2020 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 comment
paulw Posted December 31, 2020 Share Posted December 31, 2020 This is a great idea. Thanks for making this workflow! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now