Jump to content

Alfred 4.5 Beta: Take a first look at Universal Actions


Recommended Posts

We absolutely love and appreciate the enthusiasm you're all showing for the new features, and the possible further extension to it. 

 

If there's one thing you could do to help us make this process even better is to share your feedback in a structured and succinct way, e.g. a focused sentence or two on the feature suggestion, and a short paragraph explaining your use case.

 

Andrew and I do our best to acknowledge feedback here, by email and on Twitter, all while continuing development, providing support and doing all the boring business stuff that has to happen behind the scenes. As such, long stream of consciousness posts can be difficult to parse into actionable feature suggestions.

 

Again, thank you for your input, we love this community :) 

 

Cheers,
Vero

Link to comment
3 hours ago, deanishe said:

 

How do you get multiple text arguments?

 

 

By splitting the query using a Run Script action.

 

 

1 hour ago, Vero said:

If there's one thing you could do to help us make this process even better is to share your feedback in a structured and succinct way, e.g. a focused sentence or two on the feature suggestion, and a short paragraph explaining your use case.

 

Yes, sorry @Vero and @Andrew, I know I'm not always succinct as I may be trying to explain a little bit too much my idea, I'll try to make it shorter next times ;)

 

However, I thought that a workflow would be even clearer... so here is one where I try to explain my ideas: https://d.pr/f/O2e7T7

 

In short, I'm showing my idea on:

  • Splitting a query to pop the multi-argument text action list and manipulate the array (here I'm doing a sort items)
  • Showing by first passing from a Single-Argument text action or passing directly with a HotKey
  • Showing my idea of how a workflow object could split the query to make it easier for everyone to pop the multi-argument text action
  • Doing an action with a predefined delimiter to use for the split (ex: using newline "\n")
  • Doing the same action, but making it more universal by asking the user for the delimiter to use to split the query and saving it as a workflow environment variable to use it again while joining back to a single argument output

While doing this, I thought it would be great to restrict the action to appear only in a Multi-Argument Text Action list. So it could be great if the "Accepts multiple argument" parameter of the Universal Action trigger could be a drop-down menu with the choice to appear on:

  • Only in single-argument query
  • On single and multi-argument query
  • Only on mutli-argument query
Link to comment
45 minutes ago, GuiB said:

I thought it would be great to restrict the action to appear only in a Multi-Argument Text Action list. So it could be great if the "Accepts multiple argument" parameter of the Universal Action trigger could be a drop-down menu with the choice to appear on:

  • Only in single-argument query
  • On single and multi-argument query
  • Only on mutli-argument query

 

This is a great full example of an enhancement request, simple and clear.

 

Could you give an example of a use case for "Only on mutli-argument query" as this hasn't been asked for before with the File Action in Alfred, but I know that actions will be used much more from this point forward.

Link to comment
3 minutes ago, Andrew said:

 

This is a great full example of an enhancement request, simple and clear.

 

Could you give an example of a use case for "Only on mutli-argument query" as this hasn't been asked for before with the File Action in Alfred, but I know that actions will be used much more from this point forward.

 

As an example, if you look at my workflow posted just above, I have an action that sort the items of the multi-argument query. So, I would prefer those actions that works on multi-argument to not appear on single argument query since they won't do anything. I mean, actions like:

  • Sort items (where each items is an argument to the multi-argument query; if the argument is single, then nothing could be done here)
  • Same thing for: Output items as numbered list or lettered list. If there's simply one item, then this won't be useful
  • If each line is a paragrah and we want to insert something between (ex: insert a markdown line"---" between each paragraph), then it won't be useful if there's only one paragraph

In short, this could be useful to tidy our list between single vs multi-argument query.

Link to comment
13 minutes ago, deanishe said:

 

I mean natively, as in multiple text items on the clipboard.

Ah, you were asking me if I know a way to put multiple text items on the clipboard natively! Not that I know as well. That's why I'm preprocessing the selection. There's text editors that allow to have multiple selection, but I think they all copy with a newline delimiter between selections, so we can't be sure if it's simply a multiline item or a multi-selection.

 

However, one way I can think of that could be used natively in Alfred (sorry, again a new feature request ;) ) would be to have a Text Buffer. In short, like the File Buffer with Opt+Up arrow to add an item to the buffer and other shortcuts. This would be useful in the Clipboard History viewer where we could select multiple items and send them to the Text Actions at once. We can already send an item into the Text Action from there, so it would be a way to send multiple items easily.

Link to comment

@Andrew, another little bug I'm seeing

 

From the Clipboard History we can go into the Universal Action Panel using the right arrow key or the tab key. However, 'fn' and 'ctrl' doesn't work even if they are checked at the "Show Actions" section inside the Universal Actions preference.

Link to comment
7 hours ago, deanishe said:

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.

 

Hm interesting, I'm definitely going to look into this thanks.

Link to comment

I've now popped a new beta build up with some fixes and improvements, available here:

 

https://cachefly.alfredapp.com/beta/Alfred_4.5_1240_beta.dmg

 

A quick summary of the changes:

  • Updated Script Filter JSON to now allow for overriding the arg with a new actions key to define the selected result action items
  • Improved multiple argument support
  • Improved argument type detection, including when calling from AppleScript
  • Added new optional AppleScript "as type" so you can force to types "text", "url", and "file", e.g.
    • tell application id "com.runningwithcrayons.Alfred" to action {"~/Desktop/", "~/Pictures/"} as type "file"
    • Alfred will automatically detect the argument type if you don't explicitly define the type
  • Fix Workflow File Action trigger to correctly respect the + file type tree prefixes [regression]
  • Added Universal Actions preview panel for when there are multiple types of objects selected (will be improved in future)
  • Improved Universal Actions view when multiple text items are selected (preview panel will be improved in future)
  • Fix Alfred to respect WebURLsWithTitlesPboardType on clipboard when copying multiple URLs
  • Fix fn/ctrl action tap in Clipboard view
  • Tweak summary text on Actions Panel view
  • Updated "Accepts Multiple" option in File Action Trigger and Universal Action Trigger to also allow for "Only Multiple Items"
  • Various other tweaks and improvements, with detailed change log to come when the Pre-release is uhh... released.

 

Thanks for all your help and suggestions so far with testing, if you could let me know if any of the things you've raised so far which should now be fixed are still not working, that would be ace :)

 

Cheers,

Andrew

Link to comment

Great! From my testing on the version build 1240 (and now 1241), everything seems to be working well. There are just some little changes that I wanted to mention to you in case they are not wanted.

 

Changes from build 1240:

  • Before, when nothing was selected and we called the Universal Action from AppleScript, then nothing would pop (no Alfred UI; we were getting an "Erreur dans Alfred 4 : No valid paths to action"), but now we are getting the Text Action with nothing (no matching actions; 0 words, 0 chars). I thought it could be a way to have an action list that appears when nothing is selected in the "Show for:" parameter inside the Universal Action workflow object, but no action appears in this situation whatever the settings are. So maybe it would be better to keep the old behaviour?

To show you the AppleScript that now pop the Text Action UI, but wasn't before:

tell application id "com.runningwithcrayons.Alfred" to action ""
  • I tested the Alt+Down Arrow shortcut inside the Clipboard History and Snippets list to see if you added my idea regarding a "Text Buffer" for sending multiple items to the Text Actions, but now it pops the Universal Action (Text Action) UI like if we did the Right Arrow or Fn or Ctrl key. I’m not sure if this is wanted (it wasn’t this way on the older build), but I thought that maybe you should prevent that in case you want to use this shortcut later so no one gets used to it since it is not specified anywhere in Alfred that this could be used for that.

Regarding the Universal Actions UI on URLs and Text Actions when multiple items are used. Yes, this is better! I know you said you will improve the UI, but just to let you know, the main thing that’s bothering me a bit is that we can’t see where the items end or if it’s simply a newline inside an item. I mean, it would be great to have a divider between each item to better see them in the preview on the right side of a Text Action.

 

Thanks for adding the "as type" to force a specific type in AppleScript. One thing I'm questioning myself is if it would be useful to set the argument to accept a list so we could force to pop the "Multiple Type" action list. I mean, to write:

tell application id "com.runningwithcrayons.Alfred" to action { "Alfred Forum URL", "alfredforum.com" } as type { "text", "url" }

At the moment, the only way to access the Multiple Type list is by omitting the "as type" option and let Alfred decide, but in this case "alfredforum.com" is not detected as an URL since there's no "https://" in front. It is right that this is not a URL, but a workflow could interpret it

 

With that said, thanks a lot for your work and thanks for including some of my ideas!

Edited by GuiB
Link to comment

Thanks for the feedback @GuiB :) 

 

2 hours ago, GuiB said:

Before, when nothing was selected and we called the Universal Action from AppleScript, then nothing would pop (no Alfred UI; we were getting an "Erreur dans Alfred 4 : No valid paths to action"), but now we are getting the Text Action with nothing (no matching actions; 0 words, 0 chars).

 

Thanks for spotting, I needed to add a check for empty string. Before, files would be checked for existence, so naturally fail.

 

2 hours ago, GuiB said:

I tested the Alt+Down Arrow shortcut inside the Clipboard History and Snippets list

 

This is actually an incorrect selector check within Alfred's framework which has only manifested now that actions can be performed everywhere. I have fixed this for the next build.

 

2 hours ago, GuiB said:

if you added my idea regarding a "Text Buffer" for sending multiple items to the Text Actions

 

This has always been in the plan, but requires an overhaul of the buffer. As such, this is not targeted for 4.5.

 

2 hours ago, GuiB said:

Thanks for adding the "as type" to force a specific type in AppleScript. One thing I'm questioning myself is if it would be useful to set the argument to accept a list so we could force to pop the "Multiple Type" action list. I mean, to write:

 

I'll add a note about adding this, it makes sense, as I have added quite a thorough way to define multiple types in the Script Filter JSON output. In your example, if you had used a full URL, Alfred will automatically recognise text and a URL, e.g.

 

tell application id "com.runningwithcrayons.Alfred" to action {"Alfred Forum URL", "https://www.alfredforum.com"}

 

Cheers,

Andrew

Link to comment
27 minutes ago, Andrew said:

Thanks for spotting, I needed to add a check for empty string. Before, files would be checked for existence, so naturally fail.

I'm not sure if you mean that you will now keep the possibility to pop the Text Action list with an empty string or not, but my point was also to let you know that the behaviour is different when called with the normal Alfred hotkey (the UI doesn't appear) vs AppleScript (the UI appears).

 

44 minutes ago, Andrew said:

This has always been in the plan, but requires an overhaul of the buffer. As such, this is not targeted for 4.5.

Great! :)

 

29 minutes ago, Andrew said:

In your example, if you had used a full URL, Alfred will automatically recognise text and a URL, e.g.

Yes I know, that's why I removed the "https://" since the idea was to "force" Alfred to a specific type. However, that's also why I'm questioning if it is really useful since many workflow won't be able to interact with the "alfredforum.com" as URL without the scheme part of the URL. I mean, it is most useful to force the type to Text than to URL or File, but if we have a custom workflow that knows what to do when it receives those kind of incomplete strings. So, since we have the possibility to force to specific types, I think the feature would be complete if a possibility to force to multiple types exist so we can make use of the different types the way we want it.

 

 

 

Link to comment
23 minutes ago, kagi said:

Now, if i could get a hotkey directly to the 'open with' action that would help me move off of LaunchBar entirely... !

Yes, that would be great! In the meantime, here is my workaround: https://d.pr/f/6uP48n

 

In short, the workflow simply connect a HotKey workflow object (that work on the selection) to a "Run Script" that contains the script:

on run argv
  tell application id "com.runningwithcrayons.Alfred" to action argv
  tell application "System Events" to keystroke "open with" & return
end run

 

Edited by GuiB
Link to comment
40 minutes ago, kagi said:

Now, if i could get a hotkey directly to the 'open with' action that would help me move off of LaunchBar entirely

 

I actually already have a ticket for the Action in Alfred workflow action to pre-select an action, but I ran out of time in 4.5. This will be in Alfred in the future though, then you'll be able to connect a hotkey to it :)

Link to comment
2 hours ago, Andrew said:

 

I actually already have a ticket for the Action in Alfred workflow action to pre-select an action, but I ran out of time in 4.5. This will be in Alfred in the future though, then you'll be able to connect a hotkey to it :)

 

Thank you, @Andrew!! I've been dying for this one! And, congrats on the big update! This is all great news. Universal Actions are awesome.

 

 

On 8/17/2020 at 11:18 AM, Jasondm007 said:

I would love to be able to directly access all of Alfred's default file actions in my workflows.

 

@Andrew recently added some awesome new actions for the buffer - and, Alfred already included some of the other default file actions, like Reveal and Browse - but I'd love to be able to access other default file actions, too - such as Open With, Recent Documents, etc. At the moment, if you want to access these without extra steps, you have to use GUI-based approaches that type the file action's name into the File Action panel, which are always imminently fragile and problematic.

 

There are a variety of ways this could be implemented, but here are some early thoughts:

  • Create a new action, in the Actions section - perhaps called Run File Action - where the user can use a drop down to select the file action they would like to run on the file paths that are being passed to it. You might think of it as a more specific application of the "Action in Alfred" action. At a minimum, the dropdown should be populated by whatever file actions the user has enabled (Features > Actions > File Actions). However, if you wanted to get fancy, it'd be even better if the dropdown included both Alfred's file actions AND any the user has created. In theory, the dropdown might operate something like Alfred's "Call External" output, except that it is displaying Alfred's default file actions and any the user created. 
  • Add a new option in the "Action in Alfred" action, which includes a dropdown allowing the user to specify the action that will be run on the file paths included above. The dropdown could operate like either of the options described above (just default file actions or include the user's file actions, too). Unless the user enables this option, of course, the default would be to send the file paths to Alfred's File Actions panel, allowing the user to select for themselves (i.e., the same way they do now).
  • Add a new option to the "Call External Trigger" output that allows the user to access Alfred's default file actions
  • Provide AppleScript access - enhance this existing "actions" command.
    • Example: tell application "Alfred" to action OpenWith theFilePaths

 

If I had to choose from these options, I'd probably go with the first or second option. But I honestly don't care how it gets accomplished! And, while I didn't include it above, if you really wanted to step things up, I would include some kind of error feedback mechanism - such as a notification, etc - for when users pass file paths to file actions they should not have - such as when they've passed more than one file to an action that can only handle one file, or when the file action is tied to a specific file type that does not match the files the user is trying to pass to it. Again, these are just fancy bells and whistles, I'm not picky here!!

 

@Andrew Is there any way we can get better access to Alfred's default file actions? 🙏 They're great, and I'd like to start tapping in to these more - as opposed to trying to recreate them myself, in a workflow, or going to GUI route. As always, thanks for your consideration! Long Live Alfred!!

 

Link to comment

Hi @Andrew, I was writing to you regarding this feature!

 

In short, that is great! but I'm questioning myself if it would be better for you to find a solution that could work to call any Universal Action item (not just the built-in) than to start with something and then make changes later on to allow the possibility... I mean, I'm just thinking in regards to the future of Alfred and its development, so you better know the inside and how this could work out and how this could be extended, but I simply just don't want you to be blocked by rapidly adding this feature.

 

I was thinking of 2 solutions:

  • Something like the "Workflow Triggers..." menu we get from the "Call External" workflow object that would give us the list of all our items for a specific type
  • Simply having a text field where we could insert the title of the item that we want Alfred to invoke (something like the standard macOS shortcut to menu items; ex: "Call item with title: name_of_title_here"). This way, Alfred could dynamically select the matching action from its title when it parses the action list when invoked.

With that said, I like the newly added "Jump to" feature to the "Action in Alfred" and from some testing this seems to work great (I tested all the actions and they popped the right UI). So, that's great to have it, thanks! I'll let you know if I get any problems while using the feature a little more.

 

One thing I think that may cause problems to some users: it's not so obvious that some items only work with specific type of items (I'm thinking that some user may ask for help why it doesn't work on their side), maybe you should filter the "Jump to" items when "Treatment" is set to a specific type so people know that some actions can't be done with those type. I know it's a little tricky for some, so maybe your mention "If no relevant arguments are passed... no actions panel will show" is enough... I'm just mentioning in case you get an idea

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