Skip to content

Commit 5c4d7c7

Browse files
committed
Update Macro_AddLocationLongLatFromAddress.md
1 parent 469a66c commit 5c4d7c7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/Examples/Macro_AddLocationLongLatFromAddress.md

+14
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@ This is especially useful for the [Obsidian Map View plugin](https://github.com/
33
You can find the script [here](./Attachments/getLongLatFromAddress.js).
44
Here is a [guide to installing user scripts](./Capture_FetchTasksFromTodoist.md) like this one.
55

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+
619
It adds a YAML property to the active file called ``location`` with `[lat, long]` as its value given the address you enter.
720

821
**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);```.
922

1023
![Demo](../Images/longLatDemo.gif)
24+

0 commit comments

Comments
 (0)