docs/manual/guide/08-capture.org

384 lines · 33219 bytes

  1#+TITLE: Capture
  2#+DESCRIPTION: Capture templates, the capture window, date trees, org-protocol, Shortcuts and the iOS share sheet.
  3#+LEDE: Capture files a note, task or link into the right place in your org files without leaving what you are doing.
  4
  5* Starting a capture
  6
  7Capture mirrors =org-capture=. Start it from anywhere in the app:
  8
  9| Preset | Key                                    |
 10|--------+----------------------------------------|
 11| Mac    | =⇧⌘N= (File ▸ Capture…)                |
 12| Emacs  | =C-c c= or =⇧⌘N=                       |
 13| Doom   | =SPC X= (normal state), =C-c c= or =⇧⌘N= |
 14
 15=⌃⌥Space= opens the capture window from any app, with orgstar in the background. Turn it off in Settings ▸ Capture, or in =config.toml=:
 16
 17#+BEGIN_SRC toml
 18[orgstar]
 19global-capture-hotkey = false
 20#+END_SRC
 21
 22The shortcut is registered as a system hot key and needs no accessibility permission.
 23
 24Captures can also arrive from a browser through org-protocol, from Shortcuts, and on iOS from the share sheet; see the sections below.
 25
 26* The capture window
 27
 28A capture goes through up to three steps.
 29
 301. *Choose a template.* The window lists your templates and groups with their keys and targets. Type a template's key, or click it. For a key of several characters, such as =wb=, each character you type narrows the list, and the header shows the keys so far (=Capture: w=). With a group for =w= (see [[*Template groups][Template groups]]), typing =w= or clicking the group lists what is in it. =Delete= removes the last key typed. The template is chosen as soon as the keys match one.
 312. *Answer its questions.* If the template has prompts (=%^{…}=, =%^g=, =%^t= and the others below), they appear as a form, after =Date for tree entry= for a template with =time-prompt=. Leave a field empty for its default. Press Return (Continue) to go on.
 323. *Edit and file.* The filled template appears in an editor, headed with the template's name and target, with the cursor where =%?= was. Press =⌘Return= (File It) to file it, or click Refile… to file it and then move it, as =C-c C-w= (=org-capture-refile=) does. Refile… asks for the target in the main window's echo area, offering the same targets as Refile in the editor (see [[file:04-outlines.org::*Refiling][Refiling]]); it appears for =entry= templates only, as in Org.
 33
 34Press Esc (Cancel) at any step to close the window without filing anything, as =org-capture-kill= does.
 35
 36Filing, the equivalent of =org-capture-finalize=, places the text in its target and saves it through the open buffer if the file is open, or into the file otherwise. A target file that doesn't exist is created, with its folders. The status line in the main window then says where the entry went.
 37
 38If filing fails, for example because a heading on an =olp= path is missing, the window stays open with your text and shows the error in red below it, so you can try again after fixing the file or cancel.
 39
 40Limits compared with Emacs:
 41
 42- The editor is a plain text editor. Org editing commands and keys such as =C-c C-c= and =C-c C-k= don't work in it; use =⌘Return= and Esc.
 43- The target is not shown while you edit (the capture buffer in Emacs is narrowed to the new entry in the target file).
 44
 45* Capturing onto an agenda day
 46
 47The + at the right of a day's header in the agenda, or =k= in the Mac agenda (=org-agenda-capture=), starts a capture for that day; see [[file:07-agenda.org][The agenda]]. Choose a template as usual. The day then stands in for today, as =org-overriding-default-time= makes it do in Org:
 48
 49- =%t=, =%T=, =%u= and =%U= give that day. The escapes with a time use the current time of day.
 50- An empty answer to a date prompt (=%^t= and the others) is that day.
 51- With =datetree = true=, the entry goes under that day in the date tree, and =time-prompt= doesn't ask.
 52
 53When the filled template is a heading without an active timestamp, orgstar adds =SCHEDULED:= with that day on the line after the heading, or at the end of the planning line when the template has one:
 54
 55#+BEGIN_SRC org
 56,* TODO Call the bank
 57SCHEDULED: <2026-10-09 Fri>
 58#+END_SRC
 59
 60The line is part of the text you edit, so you can change or remove it before filing. A template with an active timestamp of its own, such as =%t= or =%^t=, gets no =SCHEDULED= line. On the Mac, the window's header names the day, as =Capture, scheduled Fri 9 Oct=.
 61
 62* Capture templates
 63
 64Templates live in =capture.toml= in the configuration folder (=~/.config/orgstar/capture.toml= by default; see [[file:13-configuration.org][Configuration]]). Settings ▸ Capture shows its path. Each template is a =[[template]]= table:
 65
 66#+BEGIN_SRC toml
 67[[template]]
 68key = "t"
 69name = "Personal todo"
 70type = "entry"
 71file = "todo.org"
 72headline = "Inbox"
 73template = "* TODO %?\n%i\n%a"
 74prepend = false
 75#+END_SRC
 76
 77The file is read each time the capture window opens. If it doesn't exist, or none of its templates is valid, these two built-in templates are used:
 78
 79| Key | Name           | Target                      | Template              |
 80|-----+----------------+-----------------------------+-----------------------|
 81| =t= | Personal todo  | =todo.org=, heading =Inbox= | =* TODO %?\n%i\n%a=   |
 82| =n= | Personal notes | =notes.org=, heading =Inbox= | =* %u %?\n%i\n%a=   |
 83
 84A problem in the file, such as a table without a key, shows in red at the bottom of the window; the other templates still load.
 85
 86Keys of several characters are typed one character at a time, as in Emacs.
 87
 88** Template groups
 89
 90A =[[template]]= with only =key= and =name= is a group, as an entry with only a key and a description is in =org-capture-templates=:
 91
 92#+BEGIN_SRC toml
 93[[template]]
 94key = "w"
 95name = "Work"
 96
 97[[template]]
 98key = "wm"
 99name = "Meeting"
100file = "work.org"
101olp = "Meetings"
102template = "* %?"
103#+END_SRC
104
105The first list then shows =[w] Work…= in place of the templates under it; choosing it lists the templates whose keys are one character longer and start with =w=, and the groups below it. A template longer than the next key with no group for its prefix is listed anyway, so that it can still be chosen. On iOS, the Template picker names each template after its groups, as =Work › Meeting=.
106
107** Keys
108
109| Key                  | Value             | Meaning                                                                                       | Org property            |
110|----------------------+-------------------+-----------------------------------------------------------------------------------------------+-------------------------|
111| =key=                | string, required  | What you press to choose the template                                                         | key                     |
112| =name=               | string            | The name in the list; the key when omitted                                                    | description             |
113| =type=               | string            | =entry= (the default), =item=, =checkitem=, =plain= or =table-line=                           | type                    |
114| =template=           | string, required  | The text to fill; see [[*Template escapes][Template escapes]]                                 | template                |
115| =file=               | string            | The target file; required except with =id=, =clock= or =denote=                               | target                  |
116| =headline=           | string            | A heading in =file=                                                                           | =file+headline=         |
117| =olp=                | string            | An outline path in =file=, titles separated by =/=                                            | =file+olp=              |
118| =datetree=           | boolean           | Today's entry in a date tree in =file=, under =olp= if given                                  | =file+olp+datetree=     |
119| =tree-type=          | string            | =day= (the default), =week=, =month=, or groups such as ="year quarter"=, for =datetree=      | =:tree-type=            |
120| =time-prompt=        | boolean           | With =datetree=, ask which day the entry is for                                               | =:time-prompt=          |
121| =regexp=             | string            | After the first match of an Emacs regexp in =file=                                            | =file+regexp=           |
122| =id=                 | string            | The heading with this =ID= property, in any file                                              | =id=                    |
123| =clock=              | boolean           | The entry the clock is running in                                                             | =clock=                 |
124| =denote=             | boolean           | A new Denote note, asked for first; see [[file:09-links.org::*Capture][Denote capture]] | =denote-org-capture=    |
125| =prepend=            | boolean           | Put the text first rather than last                                                           | =:prepend=              |
126| =immediate-finish=   | boolean           | File without showing the editor                                                               | =:immediate-finish=     |
127| =empty-lines=        | integer           | Blank lines before and after the captured text                                                | =:empty-lines=          |
128| =empty-lines-before= | integer           | Blank lines before; overrides =empty-lines=                                                   | =:empty-lines-before=   |
129| =empty-lines-after=  | integer           | Blank lines after; overrides =empty-lines=                                                    | =:empty-lines-after=    |
130| =jump-to-captured=   | boolean           | Show the new entry in the editor after filing                                                 | =:jump-to-captured=     |
131| =clock-in=           | boolean           | Clock in to the captured entry                                                                | =:clock-in=             |
132| =clock-keep=         | boolean           | With =clock-in=, keep the clock running after filing                                          | =:clock-keep=           |
133| =clock-resume=       | boolean           | With =clock-in=, restart the clock that was running before                                    | =:clock-resume=         |
134| =table-line-pos=     | string            | Where a =table-line= goes, such as ="II-3"=                                                   | =:table-line-pos=       |
135
136=capture.toml= uses a subset of TOML: basic strings in double quotes, literal strings in single quotes, booleans and integers. Multi-line strings (="""…"""=) are not supported, so write a newline in a template as =\n= inside a double-quoted string. A double-quoted string accepts only the escapes =\"=, =\\=, =\n=, =\t=, =\uXXXX= and =\UXXXXXXXX=; any other backslash is an error. A template backslash, as in =%\1= or =\%=, is therefore written =%\\1= or =\\%= in double quotes, or as it is in a single-quoted string, which has no escapes and no =\n=.
137
138#+BEGIN_SRC toml
139[[template]]
140key = "m"
141name = "Meeting"
142file = "work.org"
143olp = "Meetings"
144template = "* %^{Topic} :meeting:\n%U\n- Attendees: %^{Attendees}\n- Topic again: %\\1\n%?"
145#+END_SRC
146
147** Targets
148
149The target keys are checked in this order: =id=, =clock=, =datetree=, =regexp=, =headline=, =olp=; with none of them the target is =file= itself.
150
151| Target                    | Where the text goes                                                                                             |
152|---------------------------+-----------------------------------------------------------------------------------------------------------------|
153| =file= alone              | The file's top level: an =entry= becomes a top-level heading at the end (or start, with =prepend=)              |
154| =headline = "Inbox"=      | Under the first heading with that exact title, at any level. If there is none, =* Inbox= is added at the end of the file |
155| =olp = "Projects/Work"=   | Under =Work=, a child of =Projects=. Every heading on the path must exist; otherwise filing fails with =Heading not found on outline path= |
156| =datetree = true=         | Under today's heading in a date tree; see [[*Date trees][Date trees]]                                           |
157| =regexp = "…"=            | At the end of the first match (its start, with =prepend=), searched ignoring case. When the match is on a heading line, as under =headline=; otherwise an =entry= goes to the file's top level, =plain= text goes at the match, and an =item= or =table-line= uses the first list or table from the match's line to the next heading. Fails with =No match for target regexp in file= |
158| =id = "…"=                | Under the heading with that =ID=, found through the workspace index. Fails with =Cannot find target ID= if no heading has it |
159| =clock = true=            | Under the heading the running clock is in. Fails with =No running clock= when no clock runs                    |
160
161=file= may be absolute (=/Users/me/org/todo.org=), start with =~/=, or be relative. A relative path is relative to the first folder in the sidebar (your home folder if you have none). Heading titles match the title text without its TODO keyword, priority or tags. Because =olp= uses =/= as its separator, a heading whose title contains =/= can't be on an outline path; use =headline= or =id= for it.
162
163Emacs's =file+function= and =function= targets, and templates read from a file (=(file "…")=), are not supported.
164
165** Template types
166
167| Type         | What is inserted                                                                                                                                         |
168|--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------|
169| =entry=      | An Org entry. If the text has no heading, =* = is added. Its level is adjusted to be one below the target heading, or 1 at the top level. Placed as the last child (first with =prepend=). Text whose first heading isn't its highest is refused: =Template is not a valid Org entry or tree= |
170| =item=       | A list item. A =- = bullet is added if the text has none. Goes after the last item of the first list in the target entry (or the file), with that list's indentation; if there is no list, at the end of the entry's text |
171| =checkitem=  | As =item=, with a =[ ]= checkbox added if there is none                                                                                                   |
172| =plain=      | The text as it is, at the end of the entry's body (with =prepend=, right after the heading line)                                                          |
173| =table-line= | A table row, in the first table in the target entry (or the file); a new table is made if there is none |
174
175For =table-line=, a text that doesn't start with a vertical bar gets one. The row goes at the end of the table. With =prepend= it goes before the first data row after the first rule. With =table-line-pos=, =II-3= means three lines above the second horizontal rule and =I+1= the first line below the first rule; an impossible position fails with =Invalid table line specification=. After the row is placed, the table is aligned and its formulas recomputed; a table whose formulas need Emacs makes the capture fail with a message that says so (see [[file:10-tables.org][Tables]]).
176
177Placement follows =org-capture-place-entry= and its siblings, including how blank lines are kept: without =empty-lines= options, a new heading gets a blank line before it when its neighbors have one (=org-blank-before-new-entry= =(heading . auto)=). Within an existing list, at most one blank line goes between items.
178
179** Clocking while capturing
180
181With =clock-in = true=, the captured entry gets a clock entry from when the template was filled to when you filed it, as Emacs clocks in while the capture buffer is open and out on finalize. With =clock-keep = true= as well, the clock keeps running in the new entry. With =clock-resume = true=, the clock that was running before the capture starts again after filing. With no clock running, clocking in to the entry first asks about open clocks, as Clock In does, as of when the capture began; on the Mac the questions are in the main window's echo area. See [[file:06-dates-and-clocking.org][Dates, scheduling and clocking]].
182
183* Template escapes
184
185These follow =org-capture-fill-template=. Escapes that need no answer are filled first; prompts are then asked in order.
186
187** Inserted values
188
189| Escape     | Inserts                                                                                                         |
190|------------+-----------------------------------------------------------------------------------------------------------------|
191| =%?=       | Nothing; the cursor goes here                                                                                   |
192| =%i=       | The initial text: the selection in the editor, or the body from org-protocol, Shortcuts or the share sheet. Later lines get the indentation of the line =%i= is on |
193| =%a=       | A link to where capture started, =[[target][description]]=                                                      |
194| =%A=       | The same link, asking for its description                                                                       |
195| =%l=       | The link as =[[target]]=, without description                                                                   |
196| =%L=       | The link target alone                                                                                           |
197| =%c=, =%x= | The clipboard's text                                                                                            |
198| =%f=       | The name of the file capture started from                                                                       |
199| =%F=       | The full path of that file                                                                                      |
200| =%n=       | Your full name from macOS                                                                                       |
201| =%k=       | The title of the entry the clock is running in                                                                  |
202| =%K=       | A link to that entry                                                                                            |
203| =%t=       | Today's date as an active timestamp, =<2026-10-07 Wed>=                                                         |
204| =%T=       | Active timestamp with the current time                                                                          |
205| =%u=       | Inactive timestamp, =[2026-10-07 Wed]=                                                                          |
206| =%U=       | Inactive timestamp with the current time                                                                        |
207| =%<…>=     | The current time formatted with a =format-time-string= pattern, such as =%<%Y-%m-%d %H:%M>=                     |
208| =%:name=   | A link property; see below                                                                                      |
209| =%[file]=  | The contents of the file; see below                                                                             |
210| =%(sexp)=  | The value of an Emacs Lisp form; see below                                                                      |
211
212From the Mac capture window, =%a= links to the heading at the cursor in the open file, as =[[file:~/org/work.org::*Heading][Heading]]=, or to the file itself before the first heading. It is empty with no file open.
213
214=%<…>= understands =%Y=, =%m=, =%d=, =%e=, =%H=, =%M=, =%S=, =%a=, =%A=, =%b=, =%B=, =%F=, =%R= and =%%=, with English day and month names. Other =format-time-string= codes are left in the text as they are.
215
216=%[file]= is replaced by the file's contents before anything else, as in Org, so escapes and prompts in the file work, and so does a =%[…]= in it. A relative path is relative to the configuration folder (the one with =capture.toml=), and =~= is your home folder. The file name runs to the last =]= on the line. A file that can't be read leaves =%![could not insert …]= in the text.
217
218=%(sexp)= evaluates the form after the other escapes are expanded, as Org does, and inserts its value: a string as it is, nothing for =nil=; any other value is an error. Escapes inside the form, such as =%i= or =%:link= in a string, are expanded with backslashes and quotes escaped. orgstar evaluates the form with its own Lisp, not Emacs: =concat=, =format=, =upcase=, =substring=, =mapconcat=, =if=, =let= and the other basic functions, plus =format-time-string= (the codes =%<…>= takes, at the capture's time or a =current-time= value), =current-time=, =user-full-name= and =read-string=. =read-string= is asked as a question before the template's =%^= prompts. A form that calls anything else stops the capture with a message naming the function.
219
220=%:name= inserts a property of the link being captured. From org-protocol these are =%:link=, =%:description= (the page title), =%:type= (the link's scheme, such as =https=), =%:annotation= (the same as =%a=) and =%:initial= (the same as =%i=). Without org-protocol, =%:annotation= and =%:initial= still work and other names insert nothing.
221
222** Prompts
223
224| Escape                         | Asks for                                                                                   |
225|--------------------------------+--------------------------------------------------------------------------------------------|
226| =%^{Prompt}=                   | A line of text                                                                             |
227| =%^g=                          | Tags, offering the tags used in the target file                                            |
228| =%^G=                          | Tags, offering every tag in your folders                                                   |
229| =%^t=, =%^T=                   | A date, inserted as an active timestamp; =%^T= always includes a time                      |
230| =%^u=, =%^U=                   | The same as an inactive timestamp                                                          |
231| =%^C=                          | Text, offering the initial text and the clipboard                                          |
232| =%^L=                          | As =%^C=, inserted as a link                                                               |
233| =%^{NAME}p=                    | A value for the property =NAME=, set in the entry's property drawer                        |
234
235=%^{Prompt|default|a|b}= asks for text with a default and suggested choices, separated by vertical bars.
236
237A name in braces before any of the keyed forms becomes its prompt: =%^{Start}T=, =%^{Context}g=. Leave a text answer empty for the default. Tags are typed separated by colons (=work:urgent=); on a heading line they are aligned to =org-tags-column=. A date takes the same input as the editor's date prompt, such as =+2d=, =fri= or =fri 14:00= (see [[file:06-dates-and-clocking.org][Dates, scheduling and clocking]]); an empty answer is today, or now for =%^T= and =%^U=. A time in the answer makes =%^t= include it.
238
239After the prompts are answered, =%\1=, =%\2= and so on insert the answer to the first, second, … text prompt (=%^{…}= only), and =%\*1=, =%\*2= the answer to the first, second, … prompt of any kind.
240
241** Escaping and unsupported escapes
242
243Put a backslash before =%= to keep it literally: =\%t= inserts =%t= (in a double-quoted TOML string, write =\\%t=). Two backslashes insert one backslash followed by the escape's value.
244
245Any other =%= sequence is left as it is.
246
247* Date trees
248
249With =datetree = true=, the entry goes under today's date in a tree of headings, as =org-datetree-find-create-entry= builds it. Missing levels are created in date order among their siblings.
250
251| =tree-type= | Levels                                                    |
252|-------------+-----------------------------------------------------------|
253| =day=       | =* 2026=, =** 2026-10 October=, =*** 2026-10-07 Wednesday= |
254| =week=      | =* 2026=, =** 2026-W41=, =*** 2026-10-07 Wednesday= (ISO week and its year) |
255| =month=     | =* 2026=, =** 2026-10 October=                            |
256
257=tree-type= may instead list the levels, any of =year=, =quarter=, =month=, =week= and =day= separated by spaces, as a list does in Org: ="year quarter month"= gives =* 2026=, =** 2026-Q4=, =*** 2026-10 October=. The levels always come in that order. With =week=, the year is the ISO week's year and the month is the month of the week's Thursday; with =week= and =quarter= but no =month=, quarters are 13-week periods. The day heading always uses the calendar date.
258
259#+BEGIN_SRC toml
260[[template]]
261key = "j"
262name = "Journal"
263file = "journal.org"
264datetree = true
265template = "* %<%H:%M> %?\n%i"
266#+END_SRC
267
268With =olp=, the tree goes under that outline path, one level down, instead of at the top of the file. The date is the day you file the capture, or, with =time-prompt = true=, the day you give for =Date for tree entry=, read as =org-read-date= reads it (=+2d=, =fri=). That date is also the template's date: without a time, a day other than today is midnight, so =%U= gives =00:00=; with a time, such as =fri 14:00=, it is that time. Org only asks for date trees, and so does orgstar.
269
270* org-protocol
271
272orgstar registers the =org-protocol:= URL scheme and handles the two handlers browser bookmarklets use, as =org-protocol.el= does in Org 9.8.7. Both the =?key=value= form and the older =:/a/b/c= form work.
273
274** capture
275
276#+BEGIN_SRC text
277org-protocol://capture?template=w&url=https%3A%2F%2Fexample.com&title=Example&body=Selected%20text
278#+END_SRC
279
280This opens the capture window with:
281
282- =template= chosen. Without =template=, the template list shows. A key with no template reports =No capture template "w"=.
283- =%a= and =%:annotation= set to =[[url][title]]= (the URL as its own description when the title is blank; the title alone when there is no URL).
284- =%i= and =%:initial= set to =body=.
285- =%:link= set to the URL, =%:description= to the title, and =%:type= to the URL's scheme.
286
287In the query form, =+= stands for a space, as in Org; encode a literal =+= as =%2B=.
288
289** store-link
290
291#+BEGIN_SRC text
292org-protocol://store-link?url=https%3A%2F%2Fexample.com&title=Example
293#+END_SRC
294
295This stores the link, so =C-c C-l= in the editor offers it (see [[file:09-links.org][Links]]), and puts the URL on the clipboard.
296
297Other handlers, such as =open-source=, report that orgstar handles only capture and store-link.
298
299** Bookmarklets
300
301Bookmarklets written for Emacs's org-protocol work unchanged. Add a bookmark with one of these as its address:
302
303#+BEGIN_SRC js
304javascript:location.href='org-protocol://capture?template=w&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())
305#+END_SRC
306
307#+BEGIN_SRC js
308javascript:location.href='org-protocol://store-link?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)
309#+END_SRC
310
311A matching web capture template:
312
313#+BEGIN_SRC toml
314[[template]]
315key = "w"
316name = "Web page"
317file = "inbox.org"
318headline = "Web"
319template = "* %:description\n:PROPERTIES:\n:URL: %:link\n:END:\n%U\n%i\n%?"
320#+END_SRC
321
322* Shortcuts
323
324The Shortcuts action Capture to orgstar files text with a template, without the capture window. It has two parameters:
325
326| Parameter    | Meaning                                                                 |
327|--------------+-------------------------------------------------------------------------|
328| Text         | The text, inserted as =%i=                                              |
329| Template Key | A template's =key= in =capture.toml=; the first template when empty     |
330
331Every prompt in the template takes its default (an empty answer: today for dates, no tags), and =%?= is ignored. =%a= is empty. On the Mac, =%c= is the clipboard and =%n= your name; on iOS both are empty, because reading the pasteboard would ask for permission on every run. The action returns a message, =Captured to …= with the target on the Mac and =Captured with …= with the template name on iOS, or fails with the same messages as the capture window. You can also say "Capture to orgstar" to Siri.
332
333On the Mac, the action opens orgstar if it isn't running and waits up to five seconds for it to be ready.
334
335* Capture on iOS
336
337The Capture button (a square with a pencil) at the top of the Agenda and Folders tabs opens the capture sheet. The + on a day's header in the Agenda tab opens it for that day, as described in [[*Capturing onto an agenda day][Capturing onto an agenda day]]; date prompts then show that day as their default. The templates come from the =capture.toml= in your synced configuration folder (see [[file:14-ios.org][iOS]]).
338
339The sheet works as on the Mac, in a form:
340
341- The Template picker chooses the template; it starts on the first one.
342- Prompts appear as fields. Date prompts have a date picker; choices and tags appear as buttons, and tapping a tag adds it.
343- Continue fills the template and shows the text to edit; File files it; Cancel discards it.
344- Refile… in the bottom bar, for =entry= templates, files the text and then shows the refile targets. If you cancel or refiling fails, the entry opens where it was filed.
345
346Differences from the Mac: there is no selection, clipboard, current file, user name or clock link to insert, so =%i= and =%a= are empty unless the capture came from a link or the share sheet, and =%c=, =%x=, =%f=, =%F=, =%n=, =%k= and =%K= are empty. An org-protocol link naming a template key that doesn't exist opens the sheet on the first template and shows =No capture template "x"= with the key.
347
348** The share sheet
349
350In another app, share a web page or text and choose orgstar. The share form has:
351
352- a Template picker, with the templates the app read the last time it ran;
353- for a link, its title (editable) and address;
354- a Text field, filled with shared text.
355
356Capture saves the item in the app group's capture inbox. The next time you open orgstar, it opens the capture sheet with the item as an org-protocol capture: the link becomes =%a= and =%:link=, the title =%:description=, and the text =%i=. Several waiting items open one after another, oldest first. If the extension says orgstar's shared folder isn't available, the app group is missing from the build and nothing can be saved.
357
358The share form lists no templates until orgstar has run once with your configuration folder; the capture sheet then starts on the first template.
359
360* Importing templates from Emacs
361
362Import from Emacs (see [[file:13-configuration.org][Configuration]] and [[file:15-alongside-emacs.org][Alongside Emacs]]) reads =org-capture-templates= and appends a =[[template]]= table to =capture.toml= for each template whose key isn't there already.
363
364| Emacs                                        | Imported as                              |
365|----------------------------------------------+------------------------------------------|
366| types =entry=, =item=, =checkitem=, =plain=, =table-line= | =type=                      |
367| =(file "f")=                                 | =file=                                   |
368| =(file+headline "f" "H")=                    | =file=, =headline=                       |
369| =(file+olp "f" "A" "B")=                     | =file=, =olp = "A/B"=                    |
370| =(file+olp+datetree "f" …)=                  | =file=, =datetree=, =olp= if a path is given |
371| =(file+datetree "f")=                        | =file=, =datetree=                       |
372| =(file+weektree "f")=                        | =file=, =datetree=, =tree-type = "week"= |
373| =(file+regexp "f" "re")=                     | =file=, =regexp=                         |
374| =(id "…")=                                   | =id=                                     |
375| =(clock)=                                    | =clock=                                  |
376| =:prepend=, =:immediate-finish=, =:jump-to-captured=, =:clock-in=, =:clock-keep=, =:clock-resume= | the boolean of the same name |
377| =:empty-lines=, =:empty-lines-before=, =:empty-lines-after=, =:table-line-pos= | the key of the same name |
378| =:tree-type=, a symbol or a list such as =(year quarter)= | =tree-type=                  |
379| =:time-prompt=                               | =time-prompt = true=                     |
380| =("w" "Work")=, a key and a description      | a group: =key= and =name=                |
381
382A file name given as a variable or a simple form is evaluated where the importer can. The import report lists what it left out: other targets, templates that aren't strings, unknown =:tree-type= values, and other properties such as =:kill-buffer= or =:unnarrowed=.
383
384Emacs resolves relative target files against =org-directory=; orgstar resolves them against the first folder in the sidebar. If =org-directory= isn't your first folder, edit the imported =file= values or make them absolute.