Skip to content

User Script Functions are not working on mobile #586

@selfire1

Description

@selfire1

Plugin informations:

  • OS: Android
  • Templater version: 1.11.3
  • Obsidian version: 1.1.1 (44)
  • Templater settings:
    • Template: "10 Meta/Templates/testing.md"
    • User function: "10 Meta/Templates/Scripts/notice.js"

Content of the template (testing.md):

<%* tp.user.notice(tp) %>

Content of the script (notice.js):

async function notice(tp) {
    const text = await tp.system.prompt("What's Good?")
    new Notice(text, 5000)
}

module.exports = notice

Describe the bug
The function doesn't run with the following error:

[error] Templater Error: Template parsing error, aborting. 
 tp.user.notice is not a function

Expected behavior
The user function runs, displaying a prompt.

Additional context

  • I have tested this with other scripts as well, none work.
  • The template folder is set to 10 Meta/Templates
  • The script folder is set to 10 Meta/Templates/Scripts
  • The script is recognised by Tenplater in the settings:
    Screenshot_20220316-173350~2.jpg

Thanks for the great work with Templater. I'd love to use user functions on mobile too, but always run into an error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions