Jump to content

Alfred 4.5 Beta: Take a first look at Universal Actions


Recommended Posts

54 minutes ago, Andrew said:

@GuiB Ah you're quite right that there is a mistake in the default adding of workflow Keywords and Script Filters. These should only be seen in Universal Actions when there are single arguments. I'll fix this :) 

Great then!


What I wanted to mention with the "not well-defined" is that I'm questioning why some actions combine the items by default (ex: "Email" + "Email to..." action), but others don't... From what I can think of is that the Email actions work with multiple elements since the "File Action" worked with multiple files before Text Actions existed, but I'm wondering why other built-in actions don't combine the items to make other built-in actions possible (ex: "Copy as Plain Text").


It's not a problem to create a workflow that would combine the items and then pop the Universal Action with the combined items as a single argument (and may be wanted in case that we don't want a new line between items), but I'm simply questioning if the default behaviour of the built-in actions should work in the same way as the "Email" actions so the behaviour is similar between each of them

Link to comment
2 hours ago, Chris Messina said:

For example, there are JSON files that I want to Prettify, and it'd be great I could use a keyboard shortcut to re-apply the last used Universal Action.

 

A separate hotkey to re-perform the previously used action on a subsequent selection is a really good idea, I'll add a note :)

 

For now, have you tried the action ordering? This will sort actions based on the argument type, so it will put the prettify action always at the top for json files:

 

action ordering.png

Link to comment
21 hours ago, Andrew said:

For now, have you tried the action ordering? This will sort actions based on the argument type, so it will put the prettify action always at the top for json files:

 

Ah, I have not! Any reason why that's not enabled by default? It might approximate what I'm seeking (though the keyboard shortcut will of course skip a step altogether!). 

Link to comment

Ok, I have more feedback. This is partially because I still don't have an accurate mental model for Universal Actions... but — I expected several things to happen here and when they didn't, I decided to share my expectations.

 

Support basic file operations like zip and unzipping

I selected two compressed files and expected to be able to unzip them with Universal Actions because they use a non-standard extension (.spa). However, to my surface, a basic utility action like this isn't included by default in Alfred. Why?

image.thumb.png.b9c2c8480e90525daf2b6eba4a488909.png

So I thought, ok, maybe I can access my macOS Extensions, Services, or Quick Actions... especially because I have The Unarchiver installed which appears when I right click and look under Services:

1392214250_CleanShot2021-08-05at15_08_37.thumb.png.cd609c0050205e27d8b9b7f1376a8dc2.png

But Services aren't part of Universal Actions. 

 

So then I thought, well, I have @deanishe's macOS Services workflow installed... maybe it will let me access those services... and that pulled up many more services, but not the ones I was looking for:

 

image.thumb.png.f03d5230d5d79dd5dd39ace9d74265d7.png

 

So, all of this is to ask:

  1. Why isn't unzipping included in the default actions?
  2. Why doesn't Alfred Universal Actions include Extensions and macOS Services?
  3. Should @deanishe's workflow functionality be incorporated into Universal Actions?

 

 

Link to comment
27 minutes ago, Chris Messina said:

I still don't have an accurate mental model for Universal Actions...

Universal Actions is, from Alfred's website:

a new way to "take any text, URLs or files and perform actions on them from anywhere within Alfred or on your Mac using your Universal Action hotkey"... "The Universal Actions panel only shows you the relevant actions for the type of item you've selected."

 

In other words, it's simply a new way to access a list of actions relevant to a specific type of selection (Files or URLs or Text) and is some kind of an extension to the File Actions.

 

At the moment, when invoked while selecting a file, we have the same list that we had with File Actions, but with Keywords + Script Filters objects if you activates those in the Universal Actions preferences section.

 

44 minutes ago, Chris Messina said:

Why isn't unzipping included in the default actions?

There was no zip/unzip action for File Actions before and no built-in actions were added at the moment. However, you can define your own action with a Universal Action object in a workflow.

 

45 minutes ago, Chris Messina said:
  • Why doesn't Alfred Universal Actions include Extensions and macOS Services?

 That would be great, maybe that will be added later...

 

48 minutes ago, Chris Messina said:

Should @deanishe's workflow functionality be incorporated into Universal Actions?

I just downloaded the workflow, I didn't really test it, but I can see that the File Action and the Script Filter object appear correctly inside the Universal Action list. However, it may be hard to know which one is which kind since they both have the same title "macOS Services".

 

So, to use @deanishe's workflow functionality you need to first select the "macOS Services" action in the Universal Action list and then the list of Services will appear. However, I never tried this workflow before, but I'm not getting my files Services, so you may not get what you want, but at least I think this gives you the idea regarding how Universal Actions work.

Link to comment
13 minutes ago, GuiB said:

a new way to "take any text, URLs or files and perform actions on them from anywhere within Alfred or on your Mac using your Universal Action hotkey"... "The Universal Actions panel only shows you the relevant actions for the type of item you've selected."

 

Yes, I do understand it from that perspective — but unzipping archives seems like something that should be automatically included in the default actions. It is not, and that surprises me.

 

For typical .zip files, I could just use the "Open" Universal Action, but in this case, I know that the underlying filetype is an archive and will be expanded by The Unarchiver. Since there is no default opener for .spa files, I can't just use the "Open" action. 

Link to comment
9 minutes ago, Chris Messina said:

Since there is no default opener for .spa files, I can't just use the "Open" action. 

Then maybe you should set a default application to use for those kind of files. (Get Info -> Open With -> The Unarchiver)

 

Or you can use the "Open with" Universal Action to specify with which application you want the file to be opened. Or you can define a File Action that would work with Zip files and ".spa" files and that would be set to open the file directly in the specified application. Here is an example with the The Unarchiver: https://d.pr/f/nT46SC

 

You may need to add one of your ".spa" file into the File Action type that it will show for. I dropped a file with a ".spa" extension on my side, but since I don't have any application that work with this kind of file, I'm not sure if the metadata are set correctly...

 

Beside, even if Alfred have a built-in unzip action, then there's good chances you won't be able to use it with your ".spa" file since this is not a standard Zip archive type. So, I think the workflow to open with The Unarchiver or to set the default app for this kind of file to The Unarchiver are your best options.

Link to comment
4 minutes ago, GuiB said:

Then maybe you should set a default application to use for those kind of files. (Get Info -> Open With -> The Unarchiver)

 

Cool, this worked, thanks. Appreciate the workflow as well.

 

Again, I was using my specific situation here to illustrate a broader point about which Universal Actions are included by default, as well as pointing out the lack of integration with macOS Services, Extensions, and Share To destinations — but you addressed my core issue in the meantime!

Link to comment
1 hour ago, Chris Messina said:

pulled up many more services, but not the ones I was looking for

 

Make sure you're using the latest version. I made a silly mistake and the workflow wasn't showing a lot of services it should have been showing.

 

1 hour ago, Chris Messina said:

Should @deanishe's workflow functionality be incorporated into Universal Actions?

 

Alfred should include macOS services, imo. They're a perfect fit for "action current selection".

 

The workflow itself can't be used very well via Universal Actions because Alfred deliberately discards so much information about the current selection and the workflow wouldn't be able to show all the services it should. It needs its own hotkey because it needs its own implementation of "get current selection".

Link to comment
22 minutes ago, GuiB said:

then there's good chances you won't be able to use it with your ".spa" file since this is not a standard Zip archive type.

 

If the filetype is defined correctly, it will be defined as a subtype of public.zip-archive.

 

You can make a File Action available for such files by adding +public.zip-archive (note the plus sign) to the Types list.

Edited by deanishe
Link to comment
2 minutes ago, Chris Messina said:

Cool, this worked, thanks. Appreciate the workflow as well.

 

I forgot to add, make sure to press the "Modify all..." button just under so all the files with this extension will be set to open with the The Unarchiver on your system.

 

4 minutes ago, Chris Messina said:

Again, I was using my specific situation here to illustrate a broader point about which Universal Actions are included by default, as well as pointing out the lack of integration with macOS Services, Extensions, and Share To destinations — but you addressed my core issue in the meantime!

Yes, I understand and I think it would be great as well to add all those things to the Universal Actions. @Andrew said that he have many plans to improve the Universal Actions feature, so those may be part of them...

 

Or in the meantime, users could create workflows to add those features. Beside, here is my version of the Zip action: https://d.pr/f/xamxKe

 

It's using the Finder Compress feature and using Automator to get a cog icon in the menubar so we know it is compressing the file.

Link to comment
2 minutes ago, deanishe said:

You can make a File Action available for such files by adding +public.zip-archive (note the plus sign) to the Types list.

You're right, I should have added the "+" character! However, since the ".spa" file isn't a standard zip file and @Chris Messina didn't have a default app to open this file, I don't think a filetype would be defined correctly and set to be a subtype of "public.zip-archive"

Link to comment

Congrats on launching the feature! I have a very specific use case, and I’m wondering if Universal Actions is the right way to solve it.

Basically, I would like to open a particular folder with a particular app. So here’s what I’m doing:

  • typing "find flexbox" gives me "~/repos/flexbox", which is what I want
  • press Right Arrow or Control to get to Universal Actions
  • select "Open with..."
  • the app I want to open this folder with is not in the default list, so I type "code" into the search field, which shows me "Visual Studio Code.app"
  • press Enter

This works, but I wonder if there’s a shorter way? For example, I use the Web Search feature a lot and all I need is type in a keyword and that will take me exactly where I want.

Link to comment
On 7/17/2021 at 11:08 AM, GuiB said:

@kagi, I don't know if you've read all the posts above, but @Andrew added the possibility to pop the "open with" action directly with the latest beta update (called "Jump to" in the "Action in Alfred" workflow object). So, if you want to use it right away you can do it!

 

Here is an updated version of my workflow I gave you, but with this new feature: https://d.pr/f/Qb4Pn2

 

Hi,

 

I am trying to see if Alfred can replace LaunchBar's Instant Send feature for me and this makes it one step closer. Thank you.

 

Is it possible to set the trigger key for this workflow to be a single press of ⌥? I tried it but it doesn't appear, so had to settle with double ⌥.

Link to comment

@Andrew I've raised the issue of when environmental variable substitution happens before, and now it's appearing in Universal Actions. At the time, @deanishe and I discussed it and concluded that it was a rare occurrence and so probably not worth changing, but with Universal Actions able to surface more actions from Workflows, I wonder if it would be worth it to take a look? 

 

I use Workflow Variables almost like localization substitutions — in particular, I set a variable for the relevant service name  (i.e. {var:service}) with which my Workflow Toolkits interacts. Without substitution, the actions in my Workflows (which are often deep searches) become much harder to access. 

 

In this example, the variables would be Facebook and GitHub, and without substitution, I can't type to search for those values:

486562978_CleanShot2021-08-09at18_29.01@2x.thumb.png.56cdd3ff42b735dc434885e98b017e15.png

Link to comment

@Chris Messina Ah the variable replacement should actually be happening here, I'll fix that for the next release.

 

This is actually different to the help ? keyword context you link to, and more akin to variable replacement in Alfred's default results for when actually using the input object. In the default results, the variable replacement happens for the input with the current variable context (which can be defined or altered over a connected workflow stream).

 

In the case of the Universal Actions, selecting a keyword action jumps directly to that object in the workflow, essentially making it a top level object (first item in a stream, even if it's much further down a stream). This means I can do variable replacement with the workflow's global variables.

 

Cheers,

Andrew

Link to comment
5 hours ago, Andrew said:

In the case of the Universal Actions, selecting a keyword action jumps directly to that object in the workflow, essentially making it a top level object (first item in a stream, even if it's much further down a stream). This means I can do variable replacement with the workflow's global variables.

 

Sweet! Very exciting!

Link to comment

I think Universal Actions are great, I've long hoped to be able to process text though Alfred like this. So thanks or this!

 

One thing would make using them easier for me is if Alfred would get a 'Instant Send' functionality (à la Launchbar) by long pressing your default shortcut for activating Alfred. A short press would just open Alfred, a long press would send the current selection to Alfred. That way you don't have yet another key combo.

 

So in my case I use control-tab to activate Alfred. Pressing control-tab and keeping the tab pressed for (let's say) a second would load the selection in Alfred for use with Universal Actions.

Link to comment
  • 4 weeks later...
On 8/10/2021 at 3:50 AM, Andrew said:

In the case of the Universal Actions, selecting a keyword action jumps directly to that object in the workflow, essentially making it a top level object (first item in a stream, even if it's much further down a stream). This means I can do variable replacement with the workflow's global variables.

 

Yay! Saw this in the Alfred 4.6 Pre-release (Build 1263) release notes! 

612248986_2021-09-13(09_39.16)AlfredPreferences.thumb.png.2b851582edbb5b9f024463dd607026e6.png

Link to comment
  • 4 weeks later...
On 6/29/2021 at 4:44 AM, dfay said:

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

@dfay Hi. Loving this. Slight offtrack but can you please include ability to add bracket () [] <> to selected words? :) Thanks

Edited by iApple
Link to comment

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...