Friday October 15, 2021; 10:12 AM EDT
- The following is the code for my insert image script. I imagine there is an easy way to share script source. Also, it would be nice to be able to change the formatting of the below to indicate source code... perhaps in the future markdown might be supported?#
- Script to insert inline image:#
- var imageFile = prompt("Enter the URL to the image file","Enter URL here");#
- op.attributes.setOne("inlineImage", imageFile);#
- Follow the instructions for creating a Scripts menu file, including the Hello World example. Create a sub under Scripts called Insert Image and beneath that copy and paste the above code, one line for each. #
- To use, place the cursor on the node where you want the image. The text of the node is the image caption. Run the script from the Scripts menu, you will be prompted to enter the URL of the image file. After it's done, publish your blog to see the result. You can also open the node attributes (click the briefcase on the toolbar) to see what the script did. #
- Perhaps in the future consideration may be made to create a node type of image, like outline and tweet, for nodes with inline images that have an associated icon to make it easy to see the nodes that are images. Tip: make the caption bold, it doesn't look too bad on the published blog and that makes the line stand out. You could also insert comment above to tell you an image follows.#
- Next step is to figure out whether one can create their own toolbar icon associate to this script. I don't see a way to call a script from the iconbar.opml, looks like I might have to copy paste. I did that with the camera font-awesome icon.#
- Note to self, you should probably do that for the "Dave" right image format. For extra credit, find the instructions Dave once made for creating one's own small image files, I think he recorded a YouTube years ago. Fortunately there is the Tools, Image browser.#