You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Examples/Macro_AddLocationLongLatFromAddress.md
+14
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,22 @@ This is especially useful for the [Obsidian Map View plugin](https://github.com/
3
3
You can find the script [here](./Attachments/getLongLatFromAddress.js).
4
4
Here is a [guide to installing user scripts](./Capture_FetchTasksFromTodoist.md) like this one.
5
5
6
+
1. Grab the script from [this page](./Attachments/getLongLatFromAddress.js). This can be done in multiple ways:
7
+
1. By clicking the 'Raw' button, and then saving the 'page' (CTRL+S on Windows, probably command+S on Mac), or
8
+
2. Copying the file contents and saving it as `getLongLatFromAddress.js`. The `.js` is _crucial_.
9
+
2. Save the file to somewhere in your vault. It doesn't matter where, as long as it's in your vault.
10
+
3. Open QuickAdd settings, and then click 'Manage Macros'.
11
+
4. Enter a macro name (I call mine 'Mapper'), and click 'Add macro'.
12
+
5. The macro should appear. Click its 'Configure' button.
13
+
6. There will be 3 input fields. Place your cursor in the one besides 'User Scripts', and it should display a suggester. Assuming you have no other `.js` files in your vault besides the one we just grabbed, it should be the only one shown. Either way, you'll want to click it, and then click 'Add'. It should get added as number 1.
14
+
7. Go back to the QuickAdd main settings. Add a new choice with a name of your choosing. This choice should be a _Macro_ choice, which can be selected using the dropdown next to the 'Add Choice' button. Add this choice, and then
15
+
8. It will appear on the list of choices. Click the ⚙ (gear) button for it, to configure it.
16
+
9. Select the macro you've just created.
17
+
10. Go back out of the QuickAdd settings. You can now run QuickAdd with the `Run QuickAdd` command in the command palette. The Choice you've made should appear.
18
+
6
19
It adds a YAML property to the active file called ``location`` with `[lat, long]` as its value given the address you enter.
7
20
8
21
**Important:** Requires MetaEdit. If you have your edit mode in MetaEdit set to All Multi, do note that you will need to remove the braces on line 23 in the script, so it looks like this: ```await createYamlProperty("location", `${lat}, ${lon}`, activeFile);```.
0 commit comments