OmniFocus Actions Pack for Keyboard Maestro

Done, the new version of OmniFocus Make Task allows you to set the flag. You can download the last version here: https://www.pierremorsa.com/mac-automation/omnifocus-action-pack-for-keyboard-maestro/

Main changes to the OmniFocus Action Pack (that I remember of :sweat_smile:):

  • Added the possibility to set the flag when creating a new action
  • Added "OmniFocus Get Flag" and "OmniFocus Set Flag" actions
  • Added "OmniFocus Plus x Days" action to answer a recurrent need I had: move the existing defer and due dates by a given number of days.

Example of Plus x Days:

  • if you use +2 days on a task with no defer date and a due date, the defer date will remain blank and 2 days will be added to the due date
  • if you use -1 day on a task with a defer date and a due date, 1 day will be substracted from the defer date and the due date.
  • if you use +1 day on a task with no defer date and no due date, nothing happens...

This is because I use due dates to define what I need to do today. This allows me to quickly move the dates around.

It's been a while since I posted here, so there are probably small changes that I forgot about. Also, I'm sorry if the new version breaks old stuff, but I have no intention to maintain backward compatibility as it would be too time consuming.

Hey Pierre,

thank you! 14 days, that was quick :slight_smile:
I guess to use it I will have to reinstall the old version and install the new one.
Just adding the new actions to the folder won`t do the job, right?

ah, sorry, I read it on your page:
"It is strongly advised to reinstall all three components each time a new version is released:"

thanks!

Hi @kornichon
Thanks for this set of actions and tools.
I'm getting the pallette of actions up within OF, but none of them are working. I just get silence.
I can see the third party actions within KM, and I get no errors.

What kind of information could I give you that could help you to offer some advice if you have the time? After the holidays of course!

Cheers!

Hello everyone and @kornichon,

I refollowed the instructions from the webpage and got this working, thank you, I'm excited to level up with OmniFocus and KM.

I'm trying to set up a palette option to set a tag, but not having any luck. The demo palette isn't changing any pallette either. The perspectives are working, so it's not that nothing works.

Am I missing something? (I fairly sure I am!)
I've tried it without the @

As the action is set up, it should add the tag "MGM" to your selected actions. The tag must already exist in OmniFocus. I also think that you are using an old version of the action pack, you can download the latest version here: Pierre Morsa | Présenter en public et GTD

The latest version of the action should allow you to specify the tag by name or by ID, see screenshot below:

Screenshot 2022-03-06 at 19h19m08s

If it doesn't work, try using "Display results in a window" instead of "Ignore results" at the bottom of the action. It may display an explanatory message about what is wrong.

Edit: sorry for not replying to you first message, I missed it in my notifications.

Aah. So if I add a new tag (and/or presumably project too) I should reinstall the action pack?

The potential here is very exciting. I'm unsure what a task ID is, I see from googling that every task has an unique ID, so the task ID field in the action is only for particular uses, and should usually be ignored?

I had used the website to get the instructions again, but didn't redownload the zips, so I'll do that. Many thanks!

EDIT 2: It's still not working for me, but I think I have two sets of actions installed now. I'll play with it some more before requesting more help. I can change the perspective now which is great, but still can't change tag. It's probably me!

EDIT 3: I have a tag working! Thanks!

1 Like

Every task, tag, project, etc. has a unique ID in OmniFocus. It is hidden from the user, but can be used in AppleScript and other scripting techniques. From a programming point of view, it is often more reliable to use the ID rather than a name that can change. Also, if the tag includes special characters (emoji, etc.), trying to set it using the name will fail, but using the ID will always work.

@kornichon,

First off, I'd just like to thank you and other members of this community for this awesome OF3 action pack. I'm late to the game here, but I've been having an issue executing certain actions from the palette, particularly the actions to set tags or set projects (I can easily navigate between perspectives and defer actions). Here's what I've done thus far to troubleshoot on my own:

  • I've ensured the OmniFocus and Apple Script Libraries are placed in the 'Script Libraries' folder in the proper location on my MacBook Pro (running 12.3.1).

  • I've made sure that the OF3 action pack items are in the appropriate folder per your installation instructions.

  • I haven't assigned hot keys for the individual actions yet, as can be seen in the included screenshot; I've only attempted to run the actions with a palette.

  • When I click on any of my tags in the palette (these tags are already created in OF3) or set a project to any of the 3 that are listed in the palette, nothing happens (visually at least) and my default system alert tone plays immediately after I click on any of the tags or projects in question.

Am I making a really foolish mistake here? I thought maybe I needed to define my tags in the Apple Script for the relevant section of code, but I held off.

Any insights would be appreciated and again, kudos to this community for making new users feel welcome.

Hi, first make sure you're using the latest version of the pack: you can download the latest version here: OmniFocus action pack

In the screenshot, you show an example of the "set perspective" action. Could you show me an example of one of the "set primary tag" action you're using? That would help me. Also, if you hear a beep, you can use the "Display results in a window" instead of "Ignore results" and hopefully it will give you an error message (I tried to return error messages whenever I could, but this being a side project, I have not tested every possible case :sweat_smile:)

Thanks for quick reply! I really appreciate it. I reinstalled the latest version, so I can hopefully rule that out.

Here's a view of setting a tag to "A Task."

I turned on my notification center alerts for KM and posted the message that appears when I try to set "A Task" as the tag.

Before I ask you any additional questions, I want to make sure I first understand what this "Set Primary Tag" action is doing. My understanding is that this action will execute when I have a task selected that does not have any tags. Is that right? I just want to account for human error on my end. :sweat_smile:

I think I just realized where I messed up. None of my "Set Primary Tags" have the relevant OF3 actions in your action pack. I'm guessing I need to add the action "OmniFocus Set Task Primary Tag" for each tag I created. If I'm getting warmer with this, would I delete the action "OmniFocus Set Primary Tag" or keep it and just add the respective OF3 action below? Good grief 🫢

I deleted the "OmniFocus Set Primary Tag" seen in the image above and added the "OmniFocus Set Task Primary Tag," filled the fields in with the correct information, and it works now.

1 Like

To clarify, here is how "Set Primary Tag" works:

  • You create a macro with the "Set Primary Tag" action. You choose which tag it's going to set (for example, it could be "home", "work", whatever you choose). The easiest way is to use my examples and use a palette macro with your own tag.
  • You select one or more tasks in OmniFocus
  • You then trigger the "Set Primary Tag" action by clicking on the macro in the palette (there are other ways to trigger the action, but I'm not going to discuss that here)
  • The Macro will then set the primary tag of each selected task to the tag you specified.

I think part of the confusion comes from the old version of the Action pack, unfortunately I am not allowed to edit the original post to prevent people from downloading the old version.

Thank you for the clarification! I’m still learning KM, but your actions pack has been a great starting place to learn how to use this application. Many thanks for this action pack and for your replies. Have a great day!

@kornichon I've got everything working now and it makes for a very smooth workflow!

2 final questions for you:

  1. For the "OmniFocus Set Task Tag List" action, is there a certain value I could enter in the "Tags:" field so all tags are removed from the selected task?

  2. For the "OmniFocus Set Task Primary Tag," is there a way to add a secondary tag? I searched this thread and came up empty handed, but I feel like I remember someone asking you this question.

  1. No, I never thought about that case. Best you can do is use the "Replace" option to set the list of tag to only the tags you specified, but that list cannot be empty. I'd need to change the code so that you can specify a blank list of tags with the "Replace" option to achieve the behaviour you describe.

  2. No, you cannot add a secondary tag with the Set Primary Tag action. You should use the "Set Primary Tag" action to set the primary tag, then use the "Set Task Tag List" with the "Add" option to add the secondary tag.

Appreciate your input!

I'm just a newbie, and ran across this wonderful set of KM tools. I am getting error(s) when I try to use the "Omnifocus Make Task" action... I assume it is meant to prompt me for task details but instead I get the following:

Macro Cancelled
Plug In failed with script error: /Users/
stephenpower/Library Application Support/
Keyboard Maestro/Keyboard Maestro
Actions/Omnifocus Make Task/Action.scpt:
, execution error: ("" "" "". "") doesn't
match the parameters {the TaskName,
theTaskNote, theProjectName,
thePrimaryTagName, Duration, Flag) for
MakeTask. (-1721). Macro "Trying"
cancelled (while executing OmniFocus M...

What am I not doing?