obsidian-meta-bind-plugin icon indicating copy to clipboard operation
obsidian-meta-bind-plugin copied to clipboard

tp.file.cursor is no longer replaced in 1.4 with templaterCreateNote

Open reply2za opened this issue 7 months ago • 1 comments

Please fill out these Check-boxes

  • [x] I checked for existing similar issues
  • [x] I checked that the plugin is up to date
  • [x] The issue persists with all other plugins and themes disabled

Plugin Version

1.4.1

This Issue Occurs on

  • [ ] Windows (not tested)
  • [ ] Linux (not tested)
  • [x] macOS
  • [ ] Android (not tested)
  • [x] iOS

Debug Info

SYSTEM INFO:
	Obsidian version: v1.8.9
	Installer version: v1.8.9
	Operating system: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 24.3.0
	Login status: logged in
	Language: en
	Catalyst license: supporter
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 3
	Restricted mode: off
	Plugins installed: 3
	Plugins enabled: 3
		1: Templater v2.11.1
		2: Dataview v0.5.68
		3: Meta Bind v1.4.1

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the Issue

On the latest version of 1.4, the templaterCreateNote button no longer resolves <% tp.file.cursor()%>. This was working as expected on version 1.3 but stopped working on version 1.4 despite all other templater methods in the same file resolving as expected. This specifically fails on 1.4 when there is a templater prompt before the file is generated.

Sample templater file:

<%*
const option = await tp.system.prompt(`Type anything`);
new Notice(tp.file.title);
%>

<%tp.file.cursor()%>

Sample button:

style: primary
label: Trip
icon: plane-takeoff
tooltip: Add a trip
actions:
  - type: templaterCreateNote
    templateFile: "templates/Notice.md"
    folderPath: Life/Travel
    openNote: true
    fileName: "Untitled Trip"

Steps to Reproduce

  • Create a templater file with a prompt and a cursor placement (try above example)
  • Create a button that is of templaterCreateNote
  • Notice that the text <% tp.file.cursor() %> remains in the newly created file

Expected Behavior

The <% tp.file.cursor() %> should contain the cursor placement instead if templater was resolved correctly.

reply2za avatar Mar 22 '25 23:03 reply2za