Vero Posted June 28, 2021 Share Posted June 28, 2021 Happy Monday all! After some intense development, Alfred 4.5 is here with a huge new feature called Universal Actions. Take a look at the beta page here for all the details, and a download link: https://www.alfredapp.com/universal-actions/ We've included a built-in workflow (under [+] > Getting Started > Universal Actions) to get you started, and we can't wait to see what custom actions you create Cheers, Vero & Andrew giovanni, nikivi, GuiB and 3 others 6 Link to comment
giovanni Posted June 28, 2021 Share Posted June 28, 2021 awesome! 😍 I repurposed a workflow to remove extra spaces when pasting from a PDF etc... works very nicely. thanks for making Alfred better and better. Vero 1 Link to comment
dfay Posted June 28, 2021 Share Posted June 28, 2021 (edited) Thanks - runs great on Big Sur. I added Universal Action triggers to my case converter workflow and it was trivially easy to do (though my muscle memory is such that I'll probably stick with hotkeys for that one ). Now available here: https://www.dropbox.com/s/3k2lh21g5wnqrkp/Case Converter 2.alfredworkflow?dl=0 Edited August 4, 2021 by dfay giovanni and Vero 2 Link to comment
Kupe Posted June 28, 2021 Share Posted June 28, 2021 Why this, "If you're already familiar with Alfred's File Actions, you can use the same hotkey you previously used for files for Universal Actions." Does Universal Actions supercede "File Actions" Link to comment
vitor Posted June 28, 2021 Share Posted June 28, 2021 (edited) 14 minutes ago, Kupe said: Does Universal Actions supercede "File Actions" Still there (see the first checkbox on the top right): And if you right click to create a Workflow node, under Triggers you find File Action and Universal Action. Here’s the difference: Universal Actions also support files, but you can’t limit them to specific types so File Actions continue to be useful. Edited June 28, 2021 by vitor Link to comment
dfay Posted June 29, 2021 Share Posted June 29, 2021 @Vero is there anything in particular that needs testing? & will there be full release notes available soon? thanks Chris Messina 1 Link to comment
Vero Posted June 29, 2021 Author Share Posted June 29, 2021 7 hours ago, dfay said: @Vero is there anything in particular that needs testing? & will there be full release notes available soon? thanks Yes, there'll be a full changelog when this goes to pre-release, and documentation will be updated by the time it goes to general availability As for testing, just use it as much as you can, trying out the built-in actions, creating your own ones, and let us know how you get on! 8 hours ago, Kupe said: Does Universal Actions supercede "File Actions" It replaces it in the Features preferences, so the hotkey you previously used to perform actions on your File Selection can now be used on text and URLs as well You'll just see relevant actions for that particular item type (e.g. a file can be revealed in Finder, a bit of text can be opened in Dictionary, a URL can be opened in a browser, etc) Just try selecting text or URLs and take a look at the actions available. dfay 1 Link to comment
Stephen_C Posted June 29, 2021 Share Posted June 29, 2021 @Andrew I see what you mean! Very many thanks: brilliant! Stephen Vero 1 Link to comment
GuiB Posted June 29, 2021 Share Posted June 29, 2021 (edited) Great new feature! Actually, I did a workflow that does that a long time a long ago that replaced the File Action with a custom Hotkey action that would detect if a file was selected or simply text or nothing and invoke the File Action or a custom workflow that give me a list of text processing actions or a custom script that would try to get the opened file from the front window if nothing was selected and then pop the File Action on the file that the script found. With this new feature, I can get the first 2 actions, but what about when nothing is selected? I understand this is maybe a bit counterintuitive, but I think it would be great to have a "fallback actions" list that would pop when nothing is selected so we could add some pre-defined actions that could be invoked to run a specific script in those circumstances... On my side I would even like to have a "pre-process" script that could be run so I can see if I can automatically run a specific script and if it doesn't get any results then it would pop the fallback actions list. Actually, by reading the text in the "Universal Action" trigger, I got the impression I could get an action that would be in the list all the time. I mean, it says: "Only show this trigger when the input argument match the type." , so I was thinking that if nothing was selected from the toggles above then it would be listed all the time since the input wouldn't match "only" the any of those types... So, I think it would be less confusing to remove the word "only" from this sentence (maybe just for myself ) or to make it act like the action will appear in all the types. This could work as some kind of fallback actions, but this would be different than having an action list when nothing is selected as I said in the above paragraph... I think I would prefer to have a specific parameter for the fallback action since now I find it greats that we can "disable" the trigger by unchecking all the toggles (I'm thinking regarding when installing a downloaded workflow where I would disable this universal action on my side). I'm not sure if I'm completely clear, so please let me know if I’m not explaining it well! With that said, thanks for this new feature! It is already really great how it is and seems to work great at the moment by playing with it a bit! Edited June 29, 2021 by GuiB Link to comment
dfay Posted June 29, 2021 Share Posted June 29, 2021 Is there any chance of extending this or making it user-extensible? Right now I have a hotkey set to act on the current selection on Mail & pull up a List Filter with some workflows & actions but this would be better I think. I have no idea if NSUserActivity could be deployed here but it seems interesting as a possibility. https://developer.apple.com/wwdc21/10264 iandol 1 Link to comment
Alfred0 Posted June 29, 2021 Share Posted June 29, 2021 1 hour ago, dfay said: Is there any chance of extending this or making it user-extensible? Right now I have a hotkey set to act on the current selection on Mail & pull up a List Filter with some workflows & actions but this would be better I think. I have no idea if NSUserActivity could be deployed here but it seems interesting as a possibility. https://developer.apple.com/wwdc21/10264 +100! This would really elevate the usefulness of this functionality to me personally (previously discussed in this topic). Example use cases that come to mind: File from the currently active window like Finder but for other apps e.g. Preview, Sketch, Pages, Keynote, etc.. URL from the currently active browser e.g. Chrome, Safari, etc.. Take a look at an app called Hook that has numerous examples of this Link to comment
Chris Messina Posted June 29, 2021 Share Posted June 29, 2021 4 hours ago, GuiB said: With this new feature, I can get the first 2 actions, but what about when nothing is selected? I understand this is maybe a bit counterintuitive, but I think it would be great to have a "fallback actions" list that would pop when nothing is selected so we could add some pre-defined actions that could be invoked to run a specific script in those circumstances... On my side I would even like to have a "pre-process" script that could be run so I can see if I can automatically run a specific script and if it doesn't get any results then it would pop the fallback actions list. It occurs to me that Quicksilver's Radial Menu Actions UI would be a pretty sweet solution here... i.e. make a selection (or not), tap your Universal Action hotkey and a menu system like this could appear on top of the selection (obviously modernized): Jono, iandol and kagi 3 Link to comment
nyc2cal Posted June 30, 2021 Share Posted June 30, 2021 Great new feature, but I've encountered some issues with usability. For example, I would often select text, send to Alfred, and rely on fallback searches to run a web search on that text. With universal actions, the list of actions is so long that the actions I would most like to apply are far down on the list. It would be useful to be able to manually sort the list of universal actions in the preferences, including which categories appear first, and to be able to manually sort the list of web searches in the preferences as well. Chris Messina, JeffreyAutomation, deanishe and 3 others 6 Link to comment
GuiB Posted July 2, 2021 Share Posted July 2, 2021 (edited) From everyone replies, I think we all always want more extensibility @Andrew, I had a play on my side and actually I'm able to get what I want (with the pre-processing of the input) by calling the Universal Actions from a workflow triggered by a Hotkey (so, like I did before, but now I can get a universal actions list instead of a specific workflow when actioned with a string). Right now, I set a condition that if there's no input then I run my script to try to get the file or the URL from the front application and then pop the Universal Actions with the found value or run another workflow if there's still nothing found. So, I would say that I'm good with my request It would be great to make it faster to have it natively inside Alfred, but I think the workflow object makes it customizable quite well. I don't know if you are trying to build something in this regards during the last days, but if so I'm sure it's going to be great and if not then I'm good with my setup! To get back to @nyc2cal, yes maybe some extra usability options could be great. I also found that with the "Workflow Keyword Inputs" and "Workflow Script Filters" ticked I have a very long list of actions, so I unchecked them at the moment and find it better. However, I think it would be great to be able to configure it more than to set it to all or nothing since there's some workflow I could benefit having there. So, what I'm thinking is maybe it could be great to add an option to the Keyword and Script Filters objects to specify if we want it to appear in the Universal Actions list or not. With that, in the Universal Actions preference, instead of having toggles, it could be a drop-down menu for those 2 types (Keywords + Script Filters) to specify if we want "all of them", "manually activated inside workflows" or "none". I know we can add the Universal Action trigger inside a workflow for that, but I'm wondering how we could disable/activate it when imported from a downloaded workflow (actually, this is something that I think would be great to add to every workflow objects: being able to disable/bypass it so we could tidy our list of actions that appears in Alfred) With that, what I've been thinking that would be great is to add an option to the Universal Action trigger to make it active or not only in specific applications. I think it would be great to add the same "Related Apps" section as the Hotkey trigger so this could be a way to tidy our list and it could be a way to create specific actions list per application (some kind of a command palette) and this could be a way to create and share workflows that "augment" each other to build a list for a specific application. Those are simply some ideas since I think we will get used to filter our list with our input like we always did with the File Actions or the standard Alfred input field, but maybe this can spark you some ideas One other point, not sure if it's a bug or not, but I've been thinking that some kind of a tagging feature could be great and be used to filter a list to items tagged with the same tag. So, what I've thought was to append the same text to the action titles that I wanted to group (ex: "Copy as Plain Text [ @text ]" ; with many spaces to try to hide the tag in the action list, just tried inside a workflow and actually the tag doesn't get hidden since Alfred truncate the middle of the string and not the end), but whenever I modify the text and press Enter then the string revert to the default one. I never tried to change the Default Actions titles so maybe it has always been this way, but I'm questioning why are we able to get a text input field if it's not to modify the title then? One last thing, it is already mentioned at the bottom of the Default Actions list that some actions will only show depending on context, maybe those contexts aware settings could be editable and could be added to the Universal Action trigger? Edited July 2, 2021 by GuiB kagi and deanishe 2 Link to comment
deanishe Posted July 2, 2021 Share Posted July 2, 2021 (edited) 1 hour ago, GuiB said: With that, what I've been thinking that would be great is to add an option to the Universal Action trigger to make it active or not only in specific applications. This would be a big help, imo. "Text" is extremely broad as types go. It would be nice to be able to have very specific actions (e.g. one that parses and processes tasks actioned in Things.app) only available at very specific times. It would also be handy if Alfred didn't reset the clipboard immediately after grabbing the selection: it throws a lot of useful information away. For example, when you copy a link in many applications, they put the title as well as the URL on the clipboard. Alfred doesn't just ignore that info itself, it actively purges it. I think Universal Actions would be a lot more universal if Alfred left that door to getting a richer representation of the selected data open. Perhaps Alfred could only reset the clipboard after the workflow has completed (without altering the clipboard itself)? Edited July 2, 2021 by deanishe Chris Messina 1 Link to comment
GuiB Posted July 2, 2021 Share Posted July 2, 2021 While I'm at it... here is another feature request for the Universal Actions! It would be great to be able to programmatically run a Universal Action, I mean, without popping the actions list. This way, we could create hotkeys that directly trig an action. One example, one file action that I'm using a lot is the "Open with..." and I think it would be great to be able to assign a hotkey that would directly activate this action so I would directly get the list of applications to open the file with instead of needing to select the action first (or doing it with a script that automates typing). The way I'm thinking of implementing it would be to add a "directly run action" parameter inside the "Action in Alfred" workflow action and where we could get the list of available actions from a drop-down menu. In short, like the "Workflow Triggers" button inside the "Call External" object. With that, it is already possible to connect another object after the "Action in Alfred". However it is run directly when the UI pop at the moment. I think it could be an option to make it blocks until the user has selected an action so we can run something after sequentially (maybe having a parameter to specify if we want to run in parallel or sequentially would be useful). This way (and with the possibility to directly run an action) we could chain multiple actions together to make it easy to build workflows with small parts from different workflows and that chain together in the order that we want. I mean, we could do something like: User select a piece of text then run a workflow that do [ "Action: Extract URLs from Text..." > "Run Script: That filter to a specific kind of URL" > "Action: Save as Snippet" ] This could be used as an alternative to the "Call External" object, but where the workflow that is called doesn't need to know the caller and calling it with a specific "Call External" object to return the result since the "Action in Alfred" object will encapsulate the input and output of the workflow. dfay and kagi 2 Link to comment
Andrew Posted July 3, 2021 Share Posted July 3, 2021 18 hours ago, deanishe said: It would also be handy if Alfred didn't reset the clipboard immediately after grabbing the selection: it throws a lot of useful information away. For example, when you copy a link in many applications, they put the title as well as the URL on the clipboard. Alfred doesn't just ignore that info itself, it actively purges it. This is an option under Alfred's Advanced preferences > Selection Hotkey... you can disable the clipboard restore. patgilmour 1 Link to comment
Andrew Posted July 3, 2021 Share Posted July 3, 2021 18 hours ago, deanishe said: Universal Action trigger to make it active or not only in specific applications This is a great idea - I'll add a note politicus 1 Link to comment
Andrew Posted July 3, 2021 Share Posted July 3, 2021 Thanks for all the feedback - Just remember that this is a new feature, and I actually have tonnes of stuff lined up to improve and enhance it over the coming releases patgilmour and JeffreyAutomation 2 Link to comment
deanishe Posted July 3, 2021 Share Posted July 3, 2021 Have you considered an option for passing copytext to the Universal Action? I don’t know how common this is, but when I’m not just doing Script Filter -> Output/Action, I tend to treat arg as workflow-internal data and put any data the user might want at that stage of the workflow in copytext. Link to comment
GuiB Posted July 3, 2021 Share Posted July 3, 2021 3 hours ago, Andrew said: Thanks for all the feedback - Just remember that this is a new feature, and I actually have tonnes of stuff lined up to improve and enhance it over the coming releases Dear @Andrew, yes we know! I'm just brainstorming a bit to try to get the most out of this feature and give ideas in case you would like to implement them at a point And actually, I just updated my workflow to implement all of my ideas and I got it working in a way that is modular based on the front application as well. So, I'm happy with the result! I'll try to find time to upload it somewhere with some documentation so everyone can have a play with it, but, in the meantime, I found a bug In short, when calling the Universal Action from AppleScript, Alfred interpret URL has simple string, so we are getting the Text Actions when we select Text as well as URLs. For example: We are getting the Universal Text Actions list with: tell application id "com.runningwithcrayons.Alfred" to action "https://www.alfredforum.com" Link to comment
GuiB Posted July 4, 2021 Share Posted July 4, 2021 (edited) Hi! While playing I wanted to see how Alfred will represent an array of strings sent to the Universal Actions (as a multiple Text arguments). At the moment it works, but it's only possible by using AppleScript/JXA since we can't split a string from Alfred. See my feature request here: For now we get the "Email to..." and "Email" actions and we can create some for ourselves. This is great, but the problem is with the preview on the right since it only shows the first text from the array, so we can't preview the complete list. Also, the words and chars count only represents the first item and there's no count of items at the top left of the popup like we have with a File Action (ex: "2 files selected") *Note: I guess we have the same problem when actioning with multiple URLs, but I can't test because of the bug from my post above ---- Edit just to add a small script as example if anyone want to test: From AppleScript: tell application id "com.runningwithcrayons.Alfred" to action { "Bonjour", "Alfred!" } Edited July 4, 2021 by GuiB Link to comment
GuiB Posted July 7, 2021 Share Posted July 7, 2021 ok, here is another one! There’s a problem with the forward slash ‘/‘ (more specifically on Text Actions). I mean, we are getting this: Multiple slashes are truncated to a single slash. Ex: ‘a//b’ or ‘a////////b’ result in => ‘a/b’ When the slash is the end of the string, then it is completely removed. Ex: ‘a/‘ or ‘a/////‘ => ‘a’ When the string is simply multiple slashes, then we are getting the File Action at the root directory. Ex: ‘////////‘ => File Action at ‘/‘ I guess it’s because the Universal Actions are based on the File Action code and there’s a pre-processing there that try to filter the forward slash Also, I was wondering if the conversion from a multi-argument query passed to a workflow object that returns a single argument (single string) could be customized. I mean, at the moment the items are returned with a tab as delimiter, which could be fine with files, but with a Text Action it is not possible to know if the query was first a single argument with tab(s) inside or a multiple argument that was transformed to a single tab delimited string (but if we pass the query first into a script that determines that multiple arguments are presetn). One way I’m thinking that would be great to overcome the tab delimited string would be to make the delimiter customizable by adding a workflow variable that could be dynamically modified. This way, we could define a delimiter that has less risk of interfering with the content and that we could pass the workflow variable to other workflows by passing the environment variable through a Call External Trigger and that could then be retrieve there. One last point, sorry this is again a feature request, but I think it could be worth it. I think it could be useful if we could force the query to be interpreted as a specific Universal Action type. I mean, for example, in case that we are sending a URL to Alfred, but wish to run a Text action on it. For sure we could set the action to work on URL and Text, but I think the point of having File/URL/Text actions is to better group our actions for specific situations or we could simply have Text actions that work with everything… How I could think to implement this would be to add a parameter to "Force interpretation to: [select type: File/URL/Text]" inside the "Action in Alfred" workflow object and also having a shortcut to switch between different Universal Action type while being inside the Universal Action popup. I mean, like in the Alfred File Browser popup we have the "Hide Preview Panel" and other shortcuts (having the menu would be great as well to learn the shortcuts. Link to comment
deanishe Posted July 7, 2021 Share Posted July 7, 2021 4 hours ago, GuiB said: but with a Text Action it is not possible to know if the query was first a single argument with tab(s) How do you get multiple text arguments? File lists are a thing, so you can select/copy multiple files, but is it possible to put multiple texts on the clipboard? Multiple URLs is possible: Safari, Chrome and Firefox all put a type WebURLsWithTitlesPboardType on the clipboard if you copy multiple bookmarks. Unfortunately, Alfred ignores that type and gives you the public.utf8-plain-text value instead. Link to comment
deanishe Posted July 7, 2021 Share Posted July 7, 2021 I suppose I should expand that last bit into a separate bug report: Alfred currently doesn’t correctly handle multiple URLs. If I copy multiple bookmarks in Safari, Chrome or Firefox, they put a WebURLsWithTitlesPboardType on the clipboard that contains all the URLs. Alfred ignores this, takes the plaintext representation instead, and passes that along as a single Text argument, not one or more URLs. It also ignores the public.url value each app sets for the first of the copied URLs. This is particularly problematic in Safari because it doesn't put a plaintext representation of multiple bookmarks on the clipboard, so Alfred does nothing at all if you try to action multiple bookmarks in Safari's bookmark manager. 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