Oct 11, 2021 at 12:00
If you put an image file directly under Obsidian's vault, the display of File Explorer will be messed up.
Fortunately, there is a subfolder called assets, and you can put files other than those notes in it.
そこに保管されたファイルは 、「![[abc.png]]
」で表示される。(本来は「![[assets/abc.png]]
」とする必要があるはず)
もちろんMarkdownの書式である「![](abc.png)
」でも表示される。
※You can change the destination where the attachment will be saved in the settings.
Unlike editor apps that edit other text files, Drafts apps are intended to create drafts as their name suggests. It's not for working with existing text files. Also, the entered document is not saved as a single file in some folder.
そのため画像を表示したい時は、URLで参照できる場所に画像ファイル置き、それを参照する。(例えば、![](https://foobar.com/img/abc.png)
の様に)
But Drafts has a special folder called Previews.
In preview, place local images, JavaScript, style sheets, and other file-based assets in the **iCloud Drive/Drafts/Library/Previews/ **folder. You can also incorporate those assets into the preview by doing so. If you place the assets you want to incorporate in this folder or a subfolder of that folder, you can browse these assets through the relative path of the HTML preview template.
Previews - Drafts User Guide
iCloud Drive/Drafts/Library/Previews/abc.png
The image file in
![](abc.png)
You can refer to it.
It behaves the same as the Obsidian assets folder, and there is no need to make any changes to the draft.
Previous shortcut apps have access to locations other than in the Shortcuts folder of iCloud Drive due to the restrictions of iOS/iPadOS protection function "Sandbox", users can access places other than in the Shortcuts folder of iCloud Drive. I had to specify a place.
That's why iOS/iPadOS has become version 15 and incorporates a mechanism called "folder bookmarks" that allows you to specify folders that can be accessed in advance.
Thanks to that, without the help of apps such as Toolbox Pro and Scriptable that support folder bookmarks, _iCloud Drive/Drafts/Library/Previews/_F Forder, _iCloud Drive/Obsidian/Vault folder/assets _folder, _(in this iPhone _ on this iPad)/Obsidian/Vault folder/assets _form Da has become easy to access.
In other words, with just shortcuts, you can now copy image files in Drafts' _Previews folder to Obsidian's assets _folder.
So,
and,
I made it.
##
Insert two images in this carlet position Save images in Drafts' Previews folder action Select two images and select "Add".
And if you look at Drafts' _Previews _folder in the Files app,
You can confirm that the image file has been copied.
And in the draft,
The link to the image file was inserted. When you perform the Drafts app standard Markdown preview action, the image will be displayed. Now, copy images from Drafts' Previews folder to Obsidian vault's assets folder action
And if you look at the _assets _subfolder of Obsidian's Vault folder in the file app,
You can confirm that the image file has been copied. Perform an action to save directly to the Voault folder of Obsidian you created before.
When I opened Obsidian,
A note was displayed with an image.
##
Specify Drafts' Previews folder as shortcuts
Tap here for this action and click "Replace..." Create a Previews subfolder in the Library subfolder in the Drafts folder in iCloud Drive, select it, and select it to "Done".
Specify the Drafts Previews folder as shortcuts and Obsidian Vault assets folder
Tap here for this action and click "Replace..." Select the Previews subfolder of the Library subfolder in the Drafts folder in iCloud Drive and select "Done". Tap here for this action below it and select "Replace..." Select the assets subfolder in the Vault folder in iCloud Drive or in this iPhone/this iPad, in the Obsidian folder, and select Done.
-"2021-10-11 DraftsのPreviewsフォルダとObsidianのassetsフォルダを利用して、Draftsアプリで画像付きメモの下書きも可能に - めモらンだム・ヤード"