Jump to content

How to influence order of workflow actions


Recommended Posts

In my OmniFocus I included about 9 input script filters all starting with ".of". When I type this prefix Alfred shows me a list of all my OF workflow actions. But their order is somehow weird. They are neither ordered my their action command nor by their name nor my preferences nor anything else ... at least it seems so.

 

weirdorder.png

 

I'd like to have them in the order:

  • Inbox
  • Show project
  • Show context
  • Show perspective
  • Search project
  • Search perspective
  • Task details
  • Theme settings

 

Is there a way to influence the order?

 

I know I could add another script filter that gives me the list of actions in my desired order but that would another step into the filter chain which I would like to avoid.

Edited by _mk_
Link to comment

In my OmniFocus I included about 9 input script filters all starting with ".of". When I type this prefix Alfred shows me a list of all my OF workflow actions. But their order is somehow weird. They are neither ordered my their action command nor by their name nor my preferences nor anything else ... at least it seems so.

 

weirdorder.png

 

I'd like to have them in the order:

  • Inbox
  • Show project
  • Show context
  • Show perspective
  • Search project
  • Search perspective
  • Task details
  • Theme settings

 

Is there a way to influence the order?

 

I know I could add another script filter that gives me the list of actions in my desired order but that would another step into the filter chain which I would like to avoid.

 

if this is bin/bash, you could add something like the following:

 

 
InboxUID=$(uuidgen)
ShowProjectUID=$(uuidgen)
ShowContextUID=$(uuidgen)
ShowPerspectiveUID=$(uuidgen)
SearchProjectUID=$(uuidgen)
SearchPerspectiveUID=$(uuidgen)
TaskDetailsUID=$(uuidgen)
ThemeSettingsUID=$(uuidgen)
 
Then for the item list, use that order, and for the UID, add the identifier:
 
<item uid="$InboxUID" arg="">
<title></title>
<subtitle></subtitle>
<icon></icon>
</item>
 
Later, when Andrew incorporates a way to list our items the way we want, or to NOT remember the actionable items, it's a simple case of removing those UID generators and the named UID in the item.
Link to comment

I already use this approach for my feedback results. The problem is different in my case. The listing shown above is created by Alfred when it lists all my actions that start with ".of..."

I am sorry. I misinterpreted the question. I understand now.

Link to comment

I tried to go the road to add an additional script filter at the front of the chain. But I am stuck half way.

 

The first script filter has an optional argument. If it is empty, then the list of available actions is shown as seen in the first post. But now I am able to influence their order the way I want it. So far so good. The actions autocomplete to fill the optional argument.

 

Depending on the optional argument, the script filter should load the tasks of a project, context etc. This only works for the "inbox" and "done today" and "theme" actions as they require no other arguments.

 

All other actions would require a filter string as second argument. I was not able it working that way. Did I miss something or is my desired workflow not possible to implement with Alfred?

Link to comment

I tried to go the road to add an additional script filter at the front of the chain. But I am stuck half way.

 

The first script filter has an optional argument. If it is empty, then the list of available actions is shown as seen in the first post. But now I am able to influence their order the way I want it. So far so good. The actions autocomplete to fill the optional argument.

 

Depending on the optional argument, the script filter should load the tasks of a project, context etc. This only works for the "inbox" and "done today" and "theme" actions as they require no other arguments.

 

All other actions would require a filter string as second argument. I was not able it working that way. Did I miss something or is my desired workflow not possible to implement with Alfred?

 

When using a script filter, each item has a UID value associated to it. With Alfred's knowledge database, those items are remembered as having been actioned before and start taking precedence over others depending on the number of times used. You can avoid this behavior by having your output use a unique UID for the items each time it is executed. For instance, you could use time or a uuid generated by uuidgen. That should prevent Alfred from learning those items and keep them in the correct order.

Link to comment

When using a script filter, each item has a UID value associated to it. With Alfred's knowledge database, those items are remembered as having been actioned before and start taking precedence over others depending on the number of times used. You can avoid this behavior by having your output use a unique UID for the items each time it is executed. For instance, you could use time or a uuid generated by uuidgen. That should prevent Alfred from learning those items and keep them in the correct order.

I already use random uids for the results of my task actions to have them in the desired order. This works as expected. The problem I have is related to Alfreds default search when writing a workflow keyword. Lets say I have the following action keywords defined in my worflow:

.oftp

.oftc

.oftv

When I now do a search in Alfred and type ".of" then Alfred shows me a list of all my actions starting with ".of". The problem I have is that the order of Alfred's results does not make any sense to me. They are not ordered by keyword not by name not by the time I created them or anything obvious. So how does Alfred determine the order and can it be influenced?

I also tried removing all actions and using a single script filter to list all my actions. But with this approach I have the problem that I can only pass one argument to the next step in the filter chain but I would need two: the action to be invoked and a filter string.

Link to comment

I already use random uids for the results of my task actions to have them in the desired order. This works as expected. The problem I have is related to Alfreds default search when writing a workflow keyword. Lets say I have the following action keywords defined in my worflow:

.oftp

.oftc

.oftv

When I now do a search in Alfred and type ".of" then Alfred shows me a list of all my actions starting with ".of". The problem I have is that the order of Alfred's results does not make any sense to me. They are not ordered by keyword not by name not by the time I created them or anything obvious. So how does Alfred determine the order and can it be influenced?

I also tried removing all actions and using a single script filter to list all my actions. But with this approach I have the problem that I can only pass one argument to the next step in the filter chain but I would need two: the action to be invoked and a filter string.

 

Technically that COULD be done, you would just send both in the arg value and would have to read and/or parse that in the next step. I am able to replicate this though with a new group of keywords that I created and haven't actioned any of them so I know its not from use/knowledge. I'll check in with Andrew and see what he has to say on this one.

Link to comment

Technically that COULD be done, you would just send both in the arg value and would have to read and/or parse that in the next step. I am able to replicate this though with a new group of keywords that I created and haven't actioned any of them so I know its not from use/knowledge. I'll check in with Andrew and see what he has to say on this one.

Thanks for your help.

Your solution of passing both arguments with the arg will not work ... unfortunately. The seconds argument is a user input. So I cannot code it into the arg of the feedback xml. Something like autocomplete + user input would be great...

Edited by _mk_
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...