Insert Local Image Reference example

This example action is not very polished but meant to be a utility to work with the new local asset support in HTML previews.

If you create a folder at iCloud Drive/Drafts/Library/Previews/images and place some images in it, this action will generate an HTML prompt displaying those images, allowing you to select one and have it insert a ![img](images/img.jpg] style Markdown image reference to that image which is compatible with HTML Previews.



A note about working with local assets in iCloud Drive

Web views do not trigger iCloud Drive to update files. To use them with these local assets across devices, you many need to open the folder in the Finder, or Files app on iOS, and make sure iCloud Drive has downloaded any assets in these folders if they were created or added to iCloud Drive on other devices!


It might be enough to open the file from a script action.

I am not completely sure but my first tests on iOS worked - at least if both devices are online.

Anyone with different experiences?