You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Advanced/Tasks Api.md
+25-43Lines changed: 25 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,54 +67,20 @@ console.log(taskLine);
67
67
```
68
68
69
69
> [!warning]
70
-
> This function is returns a `Promise` - always `await` the result!
70
+
> This function returns a `Promise` - always `await` the result!
71
+
72
+
> [!Tip]- Find plugins that use the Tasks API to create tasks
73
+
> [Search GitHub for plugins which may use this function](https://github.com/search?q=createTaskLineModal+NOT+is%3Afork+NOT+repo%3Aobsidian-tasks-group%2Fobsidian-tasks+NOT+path%3A*.md&type=code), and by using `createTaskLineModal()`, will fully respect your Tasks settings.
74
+
> > [!warning]
75
+
> >
76
+
> > - You will need to be logged in to GitHub for this search to work.
77
+
> > - Not all of these plugins have been reviewed by the Obsidian team: you should search for them in `Settings` > `Community plugins` - or review in [Plugins - Obsidian](https://obsidian.md/plugins) - for safety.
71
78
72
79
### Usage with QuickAdd
73
80
One of the most common usage scenarios is probably in combination with the [QuickAdd](https://github.com/chhoumann/quickadd) plugin
74
81
to automatically add tasks to a specific file.
75
82
76
-
For this you need to enter the following code as the Capture format:
@@ -130,9 +96,18 @@ const taskLine = '- [ ] This is a task 📅 2024-04-24';
130
96
131
97
const result =tasksApi.executeToggleTaskDoneCommand(taskLine, sourceFile.path);
132
98
99
+
// Do whatever you want with the returned value.
100
+
// It's just a string containing the Markdown for the toggled task.
133
101
console.log(result); // "- [x] This is a task 📅 2024-04-24 ✅ 2024-04-23"
134
102
```
135
103
104
+
> [!Tip]- Find plugins that use the Tasks API to toggle tasks
105
+
> [Search GitHub for plugins which may use this function](https://github.com/search?q=executeToggleTaskDoneCommand+NOT+is%3Afork+NOT+repo%3Aobsidian-tasks-group%2Fobsidian-tasks+NOT+path%3A*.md&type=code), and by using `executeToggleTaskDoneCommand()`, will fully respect your Tasks settings.
106
+
> > [!warning]
107
+
> >
108
+
> > - You will need to be logged in to GitHub for this search to work.
109
+
> > - Not all of these plugins have been reviewed by the Obsidian team: you should search for them in `Settings` > `Community plugins` - or review in [Plugins - Obsidian](https://obsidian.md/plugins) - for safety.
110
+
136
111
## Auto-Suggest Integration
137
112
138
113
> [!released]
@@ -165,6 +140,13 @@ This can be used, for example, to display the Auto-Suggest on non-task lines. [S
165
140
> If the `Editor` is not a `MarkdownView`, the functionality is slightly limited.
166
141
> It won't be possible to create [[Task Dependencies]] fields `id` and `dependsOn`.
167
142
143
+
> [!Tip]- Find plugins that use the Tasks API to suggest task properties
144
+
> [Search GitHub for plugins which may use this function](https://github.com/search?q=showTasksPluginAutoSuggest+NOT+is%3Afork+NOT+repo%3Aobsidian-tasks-group%2Fobsidian-tasks+NOT+path%3A*.md&type=code), and by using `showTasksPluginAutoSuggest()`, will fully respect your Tasks settings.
145
+
> > [!warning]
146
+
> >
147
+
> > - You will need to be logged in to GitHub for this search to work.
148
+
> > - Not all of these plugins have been reviewed by the Obsidian team: you should search for them in `Settings` > `Community plugins` - or review in [Plugins - Obsidian](https://obsidian.md/plugins) - for safety.
0 commit comments