Alfred - Obsidian Utilities

Hi, @Richelo .

I believe you may be confusing two different actions — the daily journal and the daily note. The former has a timestamp; the latter doesn’t.

From the text clip you shared, I’d say that you’re using the daily journal action (without having specified a journal_tag in the Environment Variables.

If this is not the case, let me know.

Cheers.

UGH … Facepalm! You are 100% correct, I AM using the daily journal, and yes, EASY to see where to edit the output.

Hours wasted looking through Python scripts, just to find it is an ID 10 T error! :rofl:

I was so naive to think that it would take forever for someone or obsidian developers themselves to connect Alfred and obsidian. I am very thankful to all you awesome people for making my work experience so rich and easier. I found it very cumbersome to go back to the daily note again and again to note something, end result being I noted much less.

All actions except the search function are working for me. Not sure what is wrong. Could someone help me figure it out?

can someone help how to use this with iCloud Drive. the vault path does not work
thanks

@ macedotavares
Just beginning with the thing I needed most: Alfred and note taking. I configured the vars in alfred workflow setting (your version 2.3.2, in Obsidian 0.12.5) and believe there is an issue with the generation of fully qualified path names.

I have all my Obsidian vaults under ~/Documents/Obsidian. For example:
~/Documents/Obsidian/Paul.
After opening the vault Paul I want to get my ToDo stuff listed their, which (ofcourse) need to get the #task stuff that I generate with keyboard shortcut ‘t’ in Alfred. In the Finder I expect to see:
~/Documents/Obsidian/Paul/ToDo.md
After entering the task in Alfred I get an entry in my Daily Note of today. This entry is a (Obsidian) link to another document. However Obsidian complains this one does not exist, but it is happy to create one for me :slight_smile: Unfortunately that does not result in my need, since the entered task is not in there.
What I do see in the Finder that in the directory ~/Document/Obsidian a new md file is present that does contain my task that I just entered. It is not stored in the directory Paul which is the vault Obsidian needs it in.

In Alfred the workflow preferences ae set to:
tasks_tag: task
tasks_file: ./__ToDo
tasks_heading: ToDo
vault_name: Paul
vault_path: ~/Documents/Obsidian

I was expecting the workflow would prepend ~/Documents/Obsidian/Paul to the file name __ToDo to get the correct path.

Am I overlooking something, or is this a glitch in the code?

That ./ in the beginning of the tasks file is likely the culprit. Just remove it and all should work as expected. Let me know if it doesn’t. Cheers!

@ macedotavares

that doesnt seem to be the solution.

I changed the filename to ‘__ToDo’ in the Alfred setting.
I cleaned the daily notes of today (this file is empy except from a header)
I removed all todo related files using Finder.
My Obsidian directory tree looks like:

~/Documents
→ Obsidian
→ Paul
→ Daily Notes
→ 2021-06-29.md
→ bunch of md files etc

Using Alfred shortcut I type ‘t This is my first task’

The finder view now gives:

~/Documents
→ Obsidian
→ __ToDo.md
→ Paul
→ Daily Notes
→ 2021-06-29.md
→ bunch of md files etc

Viewing the daily notes file I see a line is added ‘#task This is my first task’
This is a link. Hovering over it shows ‘this is not yet created. Create it?’
If I press it a file __ToDo.md is created and the FInder window now shows:

~/Documents
→ Obsidian
→ __ToDo.md
→ Paul
→ __ToDo.md
→ Daily Notes
→ 2021-06-29.md
→ bunch of md files etc

Obsidian created this file and it has no content (empty). There are now two different __ToDo.md files: one inside the vault; the other (containing the task text) outside the vault.

Hi. Can you DM me a screenshot of your configuration window? Also, please activate debugging mode, run the problematic action and send me the log. We’ll figure this out.

Cheers!

OK, I think I understand what’s going on, now.

In your configuration, the vault_name (Paul) doesn’t match the vault_path (~/Documents/Obsidian) like the workflow expects. As a result, some workflow steps are working on mismatched directories.

So, if you want to use the tasks action on the Paul directory, you must set vault_path to ~/Documents/Obsidian/Paul.

If this still doesn’t work, please activate debugging mode, run the action again and DM me the logs.

@ macedotavares

Thanks for the answer. The task stuff now places the task text in the designated file. Unfortunatly the daily note is not udated.

Debug stuff from this workflow:

[12:30:10.814] Logging Started…
[12:30:24.439] Obsidian Utilities[Keyword] Processing complete
[12:30:24.441] Obsidian Utilities[Keyword] Passing output ‘a new task’ to Arg and Vars
[12:30:24.441] Obsidian Utilities[Arg and Vars] Processing complete
[12:30:24.441] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[12:30:24.442] Obsidian Utilities[Keyword] Passing output ‘a new task’ to Run Script
[12:30:24.475] Obsidian Utilities[Run Script] Processing complete
[12:30:24.479] Obsidian Utilities[Run Script] Passing output ‘82ae7a’ to Arg and Vars
[12:30:24.479] Obsidian Utilities[Arg and Vars] Processing complete
[12:30:24.480] Obsidian Utilities[Arg and Vars] Passing output ‘~/Documents/Obsidian/Paul/__ToDo.md’ to Run Script
[12:30:24.563] Obsidian Utilities[Run Script] Processing complete
[12:30:24.564] Obsidian Utilities[Run Script] Passing output '## ToDo

  • [ ] [[2021-06-30]] testing the vailt ^271d72
  • [ ] [[2021-06-30]] het lijkt goed, dus nu gaan gebruiken ^8a3e7e
  • [ ] [[2021-06-30]] later vandaag ^15a1c4

—’ to Arg and Vars
[12:30:24.565] Obsidian Utilities[Arg and Vars] Processing complete
[12:30:24.566] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[12:30:24.612] Obsidian Utilities[Run Script] Processing complete
[12:30:24.632] Obsidian Utilities[Run Script] Passing output '## ToDo

  • [ ] [[2021-06-30]] testing the vailt ^271d72
  • [ ] [[2021-06-30]] het lijkt goed, dus nu gaan gebruiken ^8a3e7e
  • [ ] [[2021-06-30]] later vandaag ^15a1c4
  • [ ] [[2021-06-30]] a new task ^82ae7a

—’ to Conditional
[12:30:24.634] Obsidian Utilities[Conditional] Processing complete
[12:30:24.635] Obsidian Utilities[Conditional] Passing output '## ToDo

  • [ ] [[2021-06-30]] testing the vailt ^271d72
  • [ ] [[2021-06-30]] het lijkt goed, dus nu gaan gebruiken ^8a3e7e
  • [ ] [[2021-06-30]] later vandaag ^15a1c4
  • [ ] [[2021-06-30]] a new task ^82ae7a

—’ to Write Text File
[12:30:24.637] Obsidian Utilities[Write Text File] Processing complete
[12:30:24.638] Obsidian Utilities[Write Text File] Passing output ‘/Users/paul/Documents/Obsidian/Paul/__ToDo.md’ to Write Text File
[12:30:24.638] ERROR: Obsidian Utilities[Write Text File] Unable to write file ‘/Users/paul/Documents/Obsidian/Paul/Paul/DailyNotes/2021-06-30.md’ as parent folder does not exist
[12:30:24.639] Obsidian Utilities[Write Text File] Processing complete
[12:30:24.640] Obsidian Utilities[Write Text File] Passing output ‘’ to Open URL

Now the fault name and tjhe file name of the vault looksto be catenated and indeed that directory ~/Obisidian/Paul/Paul does not exist.

Renaming the vault path to the previous setting gives the following debig output:

[12:30:10.814] Logging Started…
[12:30:24.439] Obsidian Utilities[Keyword] Processing complete
[12:30:24.441] Obsidian Utilities[Keyword] Passing output ‘a new task’ to Arg and Vars
[12:30:24.441] Obsidian Utilities[Arg and Vars] Processing complete
[12:30:24.441] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[12:30:24.442] Obsidian Utilities[Keyword] Passing output ‘a new task’ to Run Script
[12:30:24.475] Obsidian Utilities[Run Script] Processing complete
[12:30:24.479] Obsidian Utilities[Run Script] Passing output ‘82ae7a’ to Arg and Vars
[12:30:24.479] Obsidian Utilities[Arg and Vars] Processing complete
[12:30:24.480] Obsidian Utilities[Arg and Vars] Passing output ‘~/Documents/Obsidian/Paul/__ToDo.md’ to Run Script
[12:30:24.563] Obsidian Utilities[Run Script] Processing complete
[12:30:24.564] Obsidian Utilities[Run Script] Passing output '## ToDo

  • [ ] [[2021-06-30]] testing the vailt ^271d72
  • [ ] [[2021-06-30]] het lijkt goed, dus nu gaan gebruiken ^8a3e7e
  • [ ] [[2021-06-30]] later vandaag ^15a1c4

—’ to Arg and Vars
[12:30:24.565] Obsidian Utilities[Arg and Vars] Processing complete
[12:30:24.566] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[12:30:24.612] Obsidian Utilities[Run Script] Processing complete
[12:30:24.632] Obsidian Utilities[Run Script] Passing output '## ToDo

  • [ ] [[2021-06-30]] testing the vailt ^271d72
  • [ ] [[2021-06-30]] het lijkt goed, dus nu gaan gebruiken ^8a3e7e
  • [ ] [[2021-06-30]] later vandaag ^15a1c4
  • [ ] [[2021-06-30]] a new task ^82ae7a

—’ to Conditional
[12:30:24.634] Obsidian Utilities[Conditional] Processing complete
[12:30:24.635] Obsidian Utilities[Conditional] Passing output '## ToDo

  • [ ] [[2021-06-30]] testing the vailt ^271d72
  • [ ] [[2021-06-30]] het lijkt goed, dus nu gaan gebruiken ^8a3e7e
  • [ ] [[2021-06-30]] later vandaag ^15a1c4
  • [ ] [[2021-06-30]] a new task ^82ae7a

—’ to Write Text File
[12:30:24.637] Obsidian Utilities[Write Text File] Processing complete
[12:30:24.638] Obsidian Utilities[Write Text File] Passing output ‘/Users/paul/Documents/Obsidian/Paul/__ToDo.md’ to Write Text File
[12:30:24.638] ERROR: Obsidian Utilities[Write Text File] Unable to write file ‘/Users/paul/Documents/Obsidian/Paul/Paul/DailyNotes/2021-06-30.md’ as parent folder does not exist
[12:30:24.639] Obsidian Utilities[Write Text File] Processing complete
[12:30:24.640] Obsidian Utilities[Write Text File] Passing output ‘’ to Open URL
[12:34:02.277] Obsidian Utilities[Keyword] Processing complete
[12:34:02.299] Obsidian Utilities[Keyword] Passing output 'a new task ’ to Arg and Vars
[12:34:02.300] Obsidian Utilities[Arg and Vars] Processing complete
[12:34:02.301] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[12:34:02.302] Obsidian Utilities[Keyword] Passing output 'a new task ’ to Run Script
[12:34:02.331] Obsidian Utilities[Run Script] Processing complete
[12:34:02.332] Obsidian Utilities[Run Script] Passing output ‘f0348f’ to Arg and Vars
[12:34:02.333] Obsidian Utilities[Arg and Vars] Processing complete
[12:34:02.334] Obsidian Utilities[Arg and Vars] Passing output ‘~/Documents/Obsidian/__ToDo.md’ to Run Script
[12:34:02.422] STDERR: Obsidian Utilities[Run Script] cat: /Users/paul/Documents/Obsidian/__ToDo.md: No such file or directory
[12:34:02.444] Obsidian Utilities[Run Script] Processing complete
[12:34:02.445] Obsidian Utilities[Run Script] Passing output ‘’ to Arg and Vars
[12:34:02.446] Obsidian Utilities[Arg and Vars] Processing complete
[12:34:02.447] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[12:34:02.480] Obsidian Utilities[Run Script] Processing complete
[12:34:02.481] Obsidian Utilities[Run Script] Passing output '## ToDo

  • [ ] [[2021-06-30]] a new task ^f0348f

—’ to Conditional
[12:34:02.482] Obsidian Utilities[Conditional] Processing complete
[12:34:02.482] Obsidian Utilities[Conditional] Passing output '## ToDo

  • [ ] [[2021-06-30]] a new task ^f0348f

—’ to Write Text File
[12:34:02.485] Obsidian Utilities[Write Text File] Processing complete
[12:34:02.485] Obsidian Utilities[Write Text File] Passing output ‘/Users/paul/Documents/Obsidian/__ToDo.md’ to Write Text File
[12:34:02.486] Obsidian Utilities[Write Text File] Processing complete
[12:34:02.487] Obsidian Utilities[Write Text File] Passing output ‘/Users/paul/Documents/Obsidian/Paul/DailyNotes/2021-06-30.md’ to Open URL

A new task file __ToDo is created in the ~/Documents/Obsidian folder, and not in the Paul (== vault) folder.

Image 30-06-2021 at 12.36

The workflow also expects the daily_folder to be located at the vault root.

In your case, that would be simply DailyNotes (without Paul/).

@macedotavares

Looking at de debug output I believe the picture is not complete…

[13:52:40.979] Obsidian Utilities[Keyword] Processing complete
[13:52:40.980] Obsidian Utilities[Keyword] Passing output ‘asd ad ad ad a as’ to Arg and Vars
[13:52:40.981] Obsidian Utilities[Arg and Vars] Processing complete
[13:52:40.981] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[13:52:40.982] Obsidian Utilities[Keyword] Passing output ‘asd ad ad ad a as’ to Run Script
[13:52:41.085] Obsidian Utilities[Run Script] Processing complete
[13:52:41.093] Obsidian Utilities[Run Script] Passing output ‘67d7ad’ to Arg and Vars
[13:52:41.094] Obsidian Utilities[Arg and Vars] Processing complete
[13:52:41.094] Obsidian Utilities[Arg and Vars] Passing output ‘~/Documents/Obsidian/__ToDo.md’ to Run Script
[13:52:41.166] STDERR: Obsidian Utilities[Run Script] cat: /Users/paul/Documents/Obsidian/__ToDo.md: No such file or directory
[13:52:41.171] Obsidian Utilities[Run Script] Processing complete
[13:52:41.172] Obsidian Utilities[Run Script] Passing output ‘’ to Arg and Vars
[13:52:41.172] Obsidian Utilities[Arg and Vars] Processing complete
[13:52:41.173] Obsidian Utilities[Arg and Vars] Passing output ‘’ to Run Script
[13:52:41.287] Obsidian Utilities[Run Script] Processing complete
[13:52:41.307] Obsidian Utilities[Run Script] Passing output '## ToDo

  • [ ] [[2021-06-30]] asd ad ad ad a as ^67d7ad

—’ to Conditional
[13:52:41.309] Obsidian Utilities[Conditional] Processing complete
[13:52:41.310] Obsidian Utilities[Conditional] Passing output '## ToDo

  • [ ] [[2021-06-30]] asd ad ad ad a as ^67d7ad

—’ to Write Text File
[13:52:41.312] Obsidian Utilities[Write Text File] Processing complete
[13:52:41.313] Obsidian Utilities[Write Text File] Passing output ‘/Users/paul/Documents/Obsidian/__ToDo.md’ to Write Text File
[13:52:41.315] Obsidian Utilities[Write Text File] Processing complete
[13:52:41.316] Obsidian Utilities[Write Text File] Passing output ‘/Users/paul/Documents/Obsidian/DailyNotes/2021-06-30.md’ to Open URL

Image 30-06-2021 at 13.54

I now see a new file __ToDo being created in ~/Documents/Obsidian, not in the vault Paul. With your suggestipn the daily notes are now not in the vault so linking from/to them from within a doc in the fault is not possible.

A temp workaround could be to create a hard link in the file system to make them accessible from the vault. However this might be too advanced for the average user (I am a Unix die hard since ages :wink: )

And indeed the above description made it work.

I created a (soft)link from Obsidian/Paul/DailyNotes to Obsidian/DailyNotes and a hardlinke from Obsidian/Paul/__ToDo.md to Paul/__ToDo.md and all the dj, dn and t Alfred commands do put the info in the corresponding file while being linkable from within the vault Paul.

I’m probably doing something really silly here, but I’m confused by the new note feature, using ‘’‘nn’’’. If I do this I get a new note with the title set to the argument I used in Alfred.

Is there anyway to get the workflow to either add to the body of that note, or to make Obsidian the active application with that note selected, so I can just start typing?

Hi, @Marwood.

I’m not near my Mac right now, and I’m not sure that I recall correctly, but I think the workflow is supposed to open the newly created note on the configured external editor. If you haven’t configured one, maybe that’s the problem.

Anyway, that doesn’t make sense anymore. The workflow should just use obsidian. I’ll change that.

Thanks!

1 Like

Ah - that makes sense. I’ve not configured an external editor - I’m trying to stick with different editors for different contexts - Obsidian for Zettelkasten and GTD Reference Material, Bear for long-form writing, and Drafts for the stuff I just brain dump before finding a proper home for it (Although Obsidian is quickly taking over for that, with your append to Day Note tool)

Thanks :blush:

Another slightly odd issue, again, likely related to me being dense.

If I use the add journal entry command, it creates a new note in the root of my Day Notes folder (Red in the attached). If I use the "Open day’s daily note’ command it creates a nested folder structure (Green in attached).

How do I get the two commands to look at the same note? Ideally I’d like the nested folder structure, but with the note having the full date as the title (So yyyy-mm-dd eeee, but inside the folder structure)
Vault_101_-_Obsidian_v0_12_10

1 Like

Hi! I just built some LaunchBar actions for Obsidian. Not sure is exactly what you are looking for. But maybe you get some hints and come up with your own.

3 Likes

Hi! This looks interesting! I was using some cludgy shortcuts with a combination of BTT and LaunchBar’s ability to append text to any text file. I’ll take a look at this later. The search script looks quite useful.

I use “v” to open my vault, but the vault does not open, any thoughts??? And I greatly thank you for all your hard work and dedication.