Acidham / alfred-markdown-notes

Alfred Markdown Notes management
126 stars 16 forks source link

template selector doesn't work #18

Closed younho9 closed 3 years ago

younho9 commented 3 years ago

Jun-29-2021 13-47-29

Create note based on Template command doesn't work.

OS: macOS 11.2.3

Acidham commented 3 years ago

I need the following:

  1. Settings of the workflow... type .mdconfig > screenshot
  2. Debug output when you type in mdc and enter on "Create Note...."
younho9 commented 3 years ago
  1. Settings of the workflow... type .mdconfig > screenshot

image

  1. Debug output when you type in mdc and enter on "Create Note...."

image

Acidham commented 3 years ago

Are you using latest version 3.1.2 of the workflow from my github repo?

It is strange that the screenshot shows a setting nametemplate_path. I never added such a setting nor implemented it. Normally, there must be a setting called template_tag but not template_path. See README.md

younho9 commented 3 years ago

It is correct that using the latest version.

I added template_path because Create New MD Note command couldn't find the template I wanted and I found this value in create_note.py and added it.

Now, delete template_path value and set template_tag, and create with tag but Created note based on Template command doesn't work.

I expected this command to provide a choice window to choose from among several templates. Create New MD Note command is work. (Find template with tamplate_tag registered and create note)

Acidham commented 3 years ago

Ok now define template_tag e.g. #template with #template and create a note and add #template to YAML Tag, save it. Then try again...

younho9 commented 3 years ago

Jun-30-2021 09-18-57

Defining a template_tag and finding a template list works.

However, selecting a template does not generate notes.

Acidham commented 3 years ago

You mentioned before that you hacked around with the workflow. Can you please delete and reinstall to make sure to have a clean version installed.
It seems that the workflow messes around with template_path. Did you remove the template_path from settings?

Again, I suggest to start with a clean installation.

younho9 commented 3 years ago

image

Yes. This is the result that remove the template_path from settings and reinstalled 3.1.2

Acidham commented 3 years ago

...and does it work now ?

younho9 commented 3 years ago

Jun-30-2021 09-18-57

Defining a template_tag and finding a template list works.

However, selecting a template does not generate notes.

Sorry for the confusion.

It doesn't work ...

Like the attached image, nothing happens after selecting a template.

Acidham commented 3 years ago

The log output looks ok and same as on my machine. The next step would be to enter the title of the note in [mdc - Create note, input title] step, but it will not open.

Another difference is that "Create New Note" is missing. mdc on my machine looks like this:

Screen Shot 2021-06-30 at 11 09 29

Did you try the other keywords and check debug log? Are there any errors?

younho9 commented 3 years ago

It works after rebooting the computer!

After my mistake regarding template_path, I removed the workflow and reinstalled it. And set the variable using the environment variable settings in Alfred, but it did not work properly.

However, I found that the value in the environment variable settings in Alfred and environment variable displayed in .mdconfig and the were different.

And when I rebooted, it worked properly. It was completely my fault to modify the template_path at first.

I am sorry for wasting your time, and thnak you for your answer. Also, thank you for making great tool.

Acidham commented 3 years ago

🙈 glad to hear that it works now! Have fun! Happy notetaking ;)

yarub123 commented 1 year ago

@Acidham Hey man, I'm a little confused on this whole template thing. When I removed it form userconfiguration creating any note stopped working so I put it back. Now it works.

I don't think I'm understanding this "create a template" option....

I guess I'm just not understanding how to use it?

Thanks in advance.

Acidham commented 1 year ago

You are seeing this because the Workflow does not find a template and uses a fallback template.

To create a template, just create a note with the #<Template> tag you specified in User configuration. For example, you defined yo as the template tag in user configuration and create a template which contains at least #yo as tag. That's it. let me know if it works; otherwise I can send you a screen recording.

yarub123 commented 1 year ago

@Acidham My notification settings on GitHub were horrible. Never got the notification for this.

But thank you for the kind response and the offer to help even more. It helped and I ended up learning how to do it by trial and error loool. Apparently in life, things taste sweeter when you work for them lol.

Edit: @Acidham One more question sorry. Idk if it's because of python3 but .mdconfig returns nothing for me. the KeyError is: 'variables' and other few errors like the 3 errors in setup.py:

and last one in Alfred3.py

Acidham commented 1 year ago

I'm not sure what the question is, but did you read the help file "Working with Templates"? Type mdhelp to read the help file.

yarub123 commented 1 year ago

@Acidham Yeah no worries disregard that. I think I may have edited the comment I made after you already read it. The issue I'm having now is the .mdconfig option doesn't run. I posted the errors in previous comment. Thanks in advance. I tried searching and still am searching for how to fix it, surprised you replied so quick lol. Very much appreciated!

Acidham commented 1 year ago

Thank you for bringing this to my attention. With the release of Alfred 5 I migrated to the new Configure Workflow feature and forgot to remove the .mdconfig functionality. When you click on configure workflow you should see all config options correct?

Acidham commented 1 year ago

Just released new version without old .mdconfig option: https://github.com/Acidham/alfred-markdown-notes/releases/tag/v3.2.0

yarub123 commented 1 year ago

@Acidham Alright no worries. Thanks alot man for the follow ups. And yes everything works wonderfully and like you said that .mdconfig is pretty much deprecated (it was for Alfred 3).

Good man.

yarub123 commented 1 year ago

@Acidham btw just curious, for those errors I posted yesterday from py3 is "KeyError: 'variables'" simply the usage was wrong because it's a bit outdated? Should it have been something like "{$var}" instead of "${var}"?

Acidham commented 1 year ago

The error was caused because the old way I stored the variables. Setup.py was removed from the WF in the latest release. Therefore no errors anymore coming from setup.py ;)