Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs







Recent posts

Mon 21 Jun 2021

Custom Domino Extensions presentation



Thu 10 Jun 2021

Notes 12 without all the blue



Wed 5 May 2021

Pull public data into Notes on the fly


January, 2022
SMTWTFS
      01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Search the weblog





























Genii Weblog

Sometimes your own dogfood tastes good

Wed 13 Jul 2005, 02:36 PM



by Ben Langhinrichs
While I don't much like the phrase "eating your own dogfood", the concept is good.  Any software developer should use his or her own software on a regular basis.  Sometimes that is a nuisance, but sometimes, like today, it is a pleasure.  I realized that our Web Editors page had lots, as in 285, URL links, and that many of them had a target of "_top" to replace the current page, when I wanted them to have a target of "_blank" to create a new page.  I changed about ten by hand, got bored, and wrote a quick Midas script which took care of them all in about 5 seconds (plus the five minutes it took to write).  Here is the code:

Call rtitem.ConnectFormBody("", "showcase.nsf", "WebEditors")
Set rtchunk = rtitem.DefineChunk("URLLink 1")
While rtchunk.Exists
   target = rtchunk.GetTargetProperties("URLLink", "Target")
   If target <> "_blank" Then Call rtchunk.SetTargetProperties("URLLink", "Target='_blank'")
   rtchunk.GetNextTarget
Wend
rtitem.Save
Messagebox("Fixed up all " & rtitem.Everything.GetCount("URLLink") & " URL hotspots")

See, your own dogfood can taste good, once in a while.  Of course, I could have written it more simply and efficiently, I now see, with:

Call rtitem.ConnectFormBody("", "showcase.nsf", "WebEditors")
Set rtchunk = rtitem.DefineChunk("URLLink *")
Call rtchunk.SetTargetProperties("URLLink", "Target='_blank'")
rtitem.Save
Messagebox("Fixed up all " & rtitem.Everything.GetCount("URLLink") & " URL hotspots")

which runs in about a second and a half, but in either case, it sure beats going to each hotspot manually.

Copyright 2005 Genii Software Ltd.

What has been said:

No documents found