Script to Insert an Image in Your Fargo Blog Post

The img attribute lets you add an image URL as a value in a headline below the title of your blog post. It is set to float right, with some padding on the left and bottom, as is Dave Winer's m.o.

  • The following is included after the image tag: style="float: right; margin-left: 25px; margin-bottom: 15px;"

This script lets you choose Insert Image from the Scripts menu, after which you paste the URL of an image in a dialog box. Hit OK and the image is added. (The Small Picture image to the right was added via this script.)

If you haven't already, create a new outline called menubar. Title the first headline Scripts. (See the Fargo Scripting blog for details.) Then paste the code below into your outline and make sure that Insert Image is indented such that it is a "child" of the Scripts headline.

  • Insert Image

    • dialog.ask ("Paste the URL of your image below", "", "here!", function (name) {

    • op.attributes.setOne("img", name);

    • });

After the menu reloads, go into your named outline and try it out. Just make sure to put the cursor in the body of your blog post, not the title.

WARNING: This script does not check that the URL you enter into the dialog box is valid. It will insert whatever you enter into the src="" following the img tag. On this headline, I entered "hi" into the dialog box, and you'll see there's a broken image to the right. If you made a mistake, click on the briefcase icon in Fargo and delete the img attribute or enter the correct image URL in the value field.

Last built: Tue, Mar 31, 2015 at 12:50 PM

By Jeffrey Kishner, Wednesday, July 31, 2013 at 8:37 AM.