Skip to content

Meta Bind Button Builder is not runnin JS when button is clicked #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 of 8 tasks
aleatorica opened this issue Apr 18, 2025 · 1 comment
Open
4 of 8 tasks
Labels
bug Undesired behavior caused by this plugin

Comments

@aleatorica
Copy link

Please fill out these Check-boxes

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

Plugin Version

1.4.1

This Issue Occurs on

  • Windows
  • Linux
  • macOS
  • Android
  • iOS

Debug Info

SYSTEM INFO:
	Obsidian version: v1.8.9
	Installer version: v1.6.7
	Operating system: Windows 11 Pro 10.0.26100
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: dark
	Community theme: none
	Snippets enabled: 1
	Restricted mode: off
	Plugins installed: 27
	Plugins enabled: 2
		1: JS Engine v0.3.2
		2: 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

MetaBind is not executing type: JS buttons using JS Engine scripts.

When clicking a button configured with type: JS and action: TaskMetadataTag.js, nothing happens — no error, no notice, no script execution. Even simple test scripts (e.g., new Notice("Hello")) do not run. Expected behavior is for the button to trigger a script located in .obsidian/Scripts/TaskMetadataTag.js

label: This is a button
icon: ""
style: default
class: ""
cssStyle: ""
backgroundImage: ""
tooltip: ""
id: ""
hidden: false
actions:
  - type: js
    file: Scripts/TaskMetadataTag.js
    args: {}

Steps to Reproduce

Steps to reproduce (what I did):

I confirmed that MetaBind is installed and working properly.

In the MetaBind settings, I made sure “Enable External JS Scripts” is turned on.

I placed a script at the path:
.obsidian/Scripts/TaskMetadataTag.js

I created a MetaBind button in a note that points to this script using type: js.

I clicked the button in both Live Preview and Reading Mode.

What actually happened:

Nothing.

No errors, no notices, no feedback at all.

The script did not run.

Expected Behavior

Expected Behavior (what should happen):

When I click the button, MetaBind should execute the script located at .obsidian/Scripts/TaskMetadataTag.js.

If the script includes something like a new Notice() or any visible output, I should see it immediately.

I expect confirmation that the script was triggered — either visually (notice or result) or through logs/errors if something goes wrong.
@aleatorica aleatorica added the bug Undesired behavior caused by this plugin label Apr 18, 2025
@mProjectsCode
Copy link
Owner

Don't place your script in .obsidian/Scripts/TaskMetadataTag.js, place it in Scripts/TaskMetadataTag.js.

With where your file is currently placed, it should say something like meta-bind | ButtonMDRC >> error while running action Error: File Scripts/TaskMetadataTag.js not found. in the console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behavior caused by this plugin
Projects
None yet
Development

No branches or pull requests

2 participants