QuickAdd Plugin

Hi!

This is a great plugin. Thanks!

I have one question: is there a way to copy macros or templates created in Quickadd between devices? I can’t find where they are stored in my hard drive…

Thanks!

Hey! Thank you.

They are in <your_vault_folder>\.obsidian\plugins\quickadd\data.json

Transferring that file between devices will transfer all of your settings.

1 Like

@Christian First of all, thanks for creating this very useful plugin.

I want to create a note from a template that has the datetime in the filename and asks for the title. So, basically whenever I use QuickAdd to add a file, I want to automatically prepend the datetime and asks for a title for the file. So, let’s say at 13:48 on 2021-09-06 I create with the name “my new file”. I want the filename to be
202109061348 new file name

Currently, I’m enabling the “File Name Format” option and use interested_directory/{{DATE:YYYYMMDDHHmm}}
to get the datetime. Then I add the title to the filename. I’m doing this many times during the day, and I was wondering if there is quick way of doing this.

Thanks

Hey @essi. Thank you!

Just to make sure I’ve understood you correctly:
You want to create a file which has the current datetime before the file name. And right now, you have the datetime part working, but have to manually write the title?

In that case, you can use {{VALUE}} or {{VALUE:variable name here}} after the datetime. Like so:
interested_directory/{{DATE:YYYYMMDDHHmm}} {{VALUE}}

The two act slightly differently, though. Here are the details:

Basically, {{VALUE}} asks for any given value - but would also be the value of your selected text (if any). {{VALUE:variable}} will always ask you for a value - unless you have given that variable a value (relevant in macros or when writing it in multiple places).

6 Likes

Thanks @Christian That was exactly what I’m looking for!

Thank you, Filipe! This is just what I was looking for :clap:

I used it to create a workaround for opening workspace with the current day Workspace Plugin Improvements: Save current workspace and open with today's note - #8 by renarl.

1 Like

Thanks for your message @renarl !

I’m glad to know that my post was helpful to you!

Have a great day!

is there a way to give input to variables? for example templater has a way to manipulate date format to change it from today to yesterday or add and subtract to it. is there anyway that i can do that with date variable?

Hey! Yeah - details here:

In Research to Notes to Stories feat. Eleanor Konik (Obsidian App) | LYT House Episode 1 - YouTube, Eleanor runs the Zettelizer macro and in addition of the new zettles there is an outline section appended to the source file.

I followed the instructions from the QuickAdd Zettelzier example, but I am missing this part of the functionality.

@Christian is it possible to share also that part of the js script or does it require a more complex setup?

2 Likes

Extended the previous mentioned zettelizer script to generate the zettels inside a folder with the same name as the source document.

If you have also the plugin Zoottelkeeper installed, it will also generate an index file with the new notes.

Example Outcome:

If you are interested, you can grab the code from here.

Thanks to @EleanorKonik and @Christian for the inspiration!

4 Likes

@Christian or anyone who can help,

Love the plug in. But, I’m having trouble with VDATE when used in the File name format inside a template choice inside a macro. Just in a stand-alone template choice it seems to work fine. Any thoughts?

This is in the file name field: {{VDATE:start,YYYY-MM-DD HHmm}} {{VALUE:series}} ({{VALUE:presenter}}) - {{VALUE: eventName}}

update: This has been resolved. It was just skipping the data fields in the popups, but now it works again. Not sure what the problem was but restarting obsidian after disabling QuickAdd, followed by restarting Obsidian and reenabling QuickAdd seemed to fix it.

I guess I’ll leave this here in case it helps anyone else.

1 Like

Now that I’ve played with it some more, I’m starting to see how amazingly useful this plugin will be!

Is there a way to use {{VDATE: someDate, YYYY-MM-DDTHH:mm}} in one area and then the same date reformatted in another spot like {{VDATE:someDATE, dddd, MMMM Do YYYY}}? I need the ISO format in the header to work with dataview, but I would like to have a nice format in the body of the markdown. That would be pretty useful.

Similarly, it would be nice to be able to reuse a dropdown choice {{VALUE:choice 1, choice 2, choice 3}} more than once with out having to choose again. like {{VALUE:name, choice 1, choice 2, choice 3}}.

3 Likes

Hey @mgamble! Glad to hear you like the plugin, and that you resolved the issue. :slight_smile:

Neither of the features are implemented yet, but I’ll take both of your suggestions as feature requests and work on them when I can.

1 Like

Hi @Christian thanks for making this amazing plug-in! :grinning:

I know nothing about Javascript (I know a bit of Python) but wanted to create a macro that can pull new messages from my Telegram bot and append it to my current note.

I would really appreciate any help! Hopefully others will find this macro useful too!

.js macro

'use-strict';

import { fetch } from './node_modules/node-fetch';

export async function getMsg() {
  let response =  await fetch('https://api.telegram.org/bot[BOT_TOKEN]/getupdates');
  let data = await response.json()
  let jsn = data.result
  console.log(jsn)
  var count = jsn.length;
  for (var i = 0; i < count; i++) {
    var message_item = jsn[i];
    var msg_text = message_item.message.text
    console.log(msg_text)
  }
  return data;
}

getMsg()

Error message:

image

The node-modules folder is in the same directory as the script

Things I’ve tried:

  1. Including "type": "module"; in local package.json
  2. Used a different import method - var fetch = import('./node_modules/node-fetch') and var fetch = require('./node_modules/node-fetch')

Sorry if this is really basic, I’m completely lost when it comes to JS. Would appreciate any help!

Hey! This might help you with creating requests :slight_smile:

Super cool what you’re building!

Thanks for the reply @Christian! Sorry to bother but in Ezimport.js, how did you import a module to use the fetch method?

@curiosity I did not import anything to use it. It’s globally accessible.

Ah ok, for some reason, running ANY macro runs into import error in my Obsidian. Unsure why this happens

That’s odd. Would you file an issue for it, so we can figure it out? :slight_smile: