[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[StrongED] Bulk insertion of text



Hi All,

Jim's question about the modes database got me to check the Choices and
Colours files to see what updates were needed to get them up to 4.70a12
level.

Replacing the 'CtrlTab' bitmap style with 'Regular' and changing the
bitmap font from 'name' to 'WxH.name' were easy. Just do a bulk replace
on all the files.

Adding the options for the Refresh texts was more of a challenge. It
required that the following lines be added to about 60 Choices files.

  Refresh_OnFirstEdit:Off
  Refresh_OnFocusGain:Off
  Refresh_AtIntervals:Off
  Refresh_StopOnEdit:Off
  Refresh_QueryUser:QueryAlways

How could this be automated, using StrongED of course, so I didn't have
to edit 60 files by hand?


After a bit of lateral thinking, here's what I came up with.

Create a new mode directory in UserPrefs.Modes named ChoicesSED. In it
save the above lines in a textfile named Refresh. Create a ModeWhen file
with these lines in it:

  Rules Include
    fff,**.Modes.*.Choices
  End

Next, create a ModeFile with a single line:

  OnLoad   SetTmp StartOfText InsertFile("<StrongED$Tmp_ModePath>.Refresh")

Click Menu over StrongED's iconbar icon and choose Rescan dir -> Modes
so that StrongED knows about the new mode.

Now Ctrl-drag the StrongED to update (I created a dummy one in the
RamDisc) to StrongED's iconbar icon. In the dbox that pops up, set the
path to *,**.Choices and click on 'Load directory'.

This will load all the Choices files and add the required refresh lines
to each file as it is loaded. All that remains is the open the LoW and
choose 'Save -> Changed' from its menu.


Hopefully the above gives a clear example of how editing multiple files
can be done using StrongED.

Cheers,
Fred.

-- 
StrongED Developer
http://www.stronged.iconbar.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at
http://diy.Torrens.org/RO/StrongED/index.html