Toggle flag on a task

Hi,

New user here.

I’m trying to setup my task system in Obsidian using the Tasks plugin. With all the queries you can make I’ve come a long way. For my daily note I have setup a query that lists me all the tasks that are available and either due soon or flagged (with a #:triangular_flag_on_post: tag).

Now I’m looking for a way to be able to flag a task by pressing a hotkey. I’ve tried to make a macro for this with QuickAdd, but couldn’t get this to work.

Any ideas?

Regards,
Alex