Extract to new note w/ Note Composer on mobile

What I’m trying to do

I am trying to extract to new notes using Note Composer on Obsidian mobile.

Things I have tried

I searched the help docs and tried creating a feature request: Button to create new note during Note Composer extraction. I am still not sure that there isn’t a way to accomplish this. I understand that usually, but not always, the mobile version has parallel functionality.

Thanks!

1 Like

Assign an icon or a shortcut if you have an external keyboard to the templater snippet (not mine):

<%*
const fileName = await tp.system.prompt("New Note Title", "Type your title here", true);
tp.file.create_new(tp.user.header(tp)+tp.file.selection(), fileName, false);
await tp.file.cursor_append("[["+fileName+"]]");
-%>
  • The last line will leave a link. Not sure it is needed or helpful.
2 Likes

Thanks! Unfortunately I can’t get it to work. Any suggestions?

Had to remove the header part (it needs a js file):

<%*
const fileName = await tp.system.prompt("New Note Title", "Type your title here", true);
tp.file.create_new(tp.file.selection(), fileName, false);
await tp.file.cursor_append("[["+fileName+"]]");
-%>
  • It may not work like this, either.

Sorry, too convoluted. Even for me it only works in special scenarios or vaults (with the js file and Folder Templates on or off).
But the gist of it is this. Maybe somebody can spot something. I cannot investigate further.

1 Like

Good point, this is an oversight on our part. There should be a button like the quick switcher has!

2 Likes

@gino_m Thanks for sharing this! I modified it a bit and wanted to share it.

<%*
const fileName = await tp.system.prompt("New Note Title", "Type your title here", true);
tp.file.create_new("---"+"\n"+"date: "+tp.date.now()+"T"+moment().format('HH:mm:ss')+"\n"+"source: "+"\""+"[["+tp.file.title+"]]"+"\""+"\n"+"status: created"+"\n"+"type: extract"+"\n"+"elements: "+"\n"+"context: "+"\n"+"keyword: "+"\n"+"---"+"\n"+"# "+fileName+"\n"+"## Summary"+"\n"+"- "+"\n"+"## Source"+"\n"+tp.file.selection()+"\n", fileName, false);
await tp.file.cursor_append("![["+fileName+"#Source]]");
-%>

Currently I am running the script via the Templater: Open Insert Template modal command via the Command Palette. Not sure if there is a way to run the script directly from a button on the mobile toolbar.

1 Like

A “Create” button will appear on mobile in v.1.4.14 (Currently available to Insiders only).

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.