chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
817 stars 40 forks source link

Bug: Append to scratchpad with a header defined does not append to header, instead just appends to end of file #158

Closed bs7280 closed 9 months ago

bs7280 commented 9 months ago

Bug Description

Append to scratchpad with a header defined (e.g. path=scratchpad#todo) will still append to the end of the file.

This also happens when making a custom workflow to use the Append to Note external trigger

I wanted to share this to 1) see if anyone else has the issue and 2) Let you know that I have been working on this, and if I can fix it, id like to let you know

Relevant Screenshot

Triggering append to scratchpad.

Note - Open Scratchpad WILL take me to the proper header in obsidian, but append to scatchpad will append to the end of file

image

Result of my scratchpad:

image

To Reproduce

  1. Set Scratchpad Note Path in config to scratchpad#todo
  2. Create the scratchpad and add a header #todo to note
  3. Trigger append to scratchnote e.g. oo Fooobar
  4. In obsidian, you will see content appended to the bottom of the note

Debugging Log

[16:38:53.322] Shimmering Obsidian[Script Filter] Queuing argument '(null)'
[16:38:57.836] Shimmering Obsidian[Keyword] Processing complete
[16:38:57.847] Shimmering Obsidian[Keyword] Passing output 'foobar' to Call External Trigger
[16:38:57.849] Shimmering Obsidian[External] Processing complete
[16:38:57.850] Shimmering Obsidian[External] Passing output 'foobar' to Arg and Vars
[16:38:57.851] Shimmering Obsidian[Arg and Vars] Processing complete
[16:38:57.853] Shimmering Obsidian[Arg and Vars] Passing output 'foobar' to Arg and Vars
[16:38:57.855] Shimmering Obsidian[Arg and Vars] Processing complete
[16:38:57.856] Shimmering Obsidian[Arg and Vars] Passing output 'foobar' to Run Script
[16:38:58.051] Shimmering Obsidian[Run Script] Processing complete
[16:38:58.055] Shimmering Obsidian[Run Script] Passing output 'scratchpad
' to Replace
[16:38:58.056] Shimmering Obsidian[Replace] Processing complete
[16:38:58.057] Shimmering Obsidian[Replace] Passing output 'scratchpad' to Conditional
[16:38:58.059] Shimmering Obsidian[Conditional] Processing complete
[16:38:58.060] Shimmering Obsidian[Conditional] Passing output 'scratchpad' to Call External Trigger
[16:38:58.066] Shimmering Obsidian[External] Processing complete
[16:38:58.068] Shimmering Obsidian[External] Passing output 'scratchpad' to Run Script
[16:38:58.361] Shimmering Obsidian[Run Script] Processing complete
[16:38:58.375] Shimmering Obsidian[Run Script] Passing output '' to Hide Alfred

Workflow Configuration

image

Version & System Information

-------------------------------
INTERNAL WORKFLOW CONFIGURATION
Vault Path: /Users/<redacted>/Documents/personalvault-1
config folder: exists
Metadata JSONs: 4/4
metadata.json String Length: 209655
-------------------------------
METADATA EXTRACTOR CONFIG
{"writingFrequency":"30","writeFilesOnLaunch":true}
-------------------------------
WORKSPACE DATA
'workspace.json' exists
-------------------------------
SYSTEM
macOS: 13.2.1
Alfred: 5.1.3
-------------------------------
INSTALLED VERSION
Obsidian: 1.4.16
This Workflow: 4.2.0
Advanced URI Plugin: 1.38.1
Metadata Extractor: 1.1.0
-------------------------------
LATEST VERSION
Obsidian: 1.4.16 (Insider: 1.4.16)
This Workflow: 4.2.0
Advanced URI Plugin: 1.38.1
Metadata Extractor: 1.1.0
-------------------------------

Make sure you have done the following

bs7280 commented 9 months ago

Update - it appears my issue had to do with case sensitive mismatch, but I was confused since the "goto heading" functionality is NOT case sensitive, but after digging deeper

This is because the latter uses an obsidian API plugin functionality, whereas the append to header functionality was implemented by the author and functions differently.

Hope this helps someone