[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[StrongED] Re: Regular Search and Replace on a key?
In article <a0d5c8e150.wra1th@xxxxxxxxxxxxxxx>,
Gavin Wraith <gavin@xxxxxxxxxxxxxxx> wrote:
> In message <50e1c585c6Lists@xxxxxxxxxxxxxx> you wrote:
> > > > While we're on the subject, is there an easy way of doing the RiscOS <>
> > > > Linux file path swap? i.e. exchange . and / in a URL?
> > Thren you understand exacrtly what I asked. But how do I use it? I
> > don't understand scripts and have looked at Lua .. grappling with a
> > small amount of Perl is difficult enough. But another language...
> > Life's now too short (I'm 66!).
> I am 7 weeks short of 71!
Then probably time for you to start learning analogue electronics?
I went the hardware route years ago, not the software route.
> What I wrote was the function, not the script. For the script we need
> to know to which strings in your StrongED window you want to apply the
> function. If to all strings then try this script:
> #! lua
> do
> local lines in io
> local slashdot = \(s)
> local slash,dot,pat = '/','.','[%./]'
> local swap = { [slash] = dot, [dot] = slash }
> => (s:gsub(pat,swap)) end -- function
> for line in lines(arg[1]) do print(slashdot(line)) end -- for
> end -- do
Then if I save that as a Filetype lua and drag it onto the scripts icon of
a window containing, for instance:
www/greenbottom/org.tolet.index/html
It should change it to
http://www.GreenBottom.org/tolet/index.html
It does nothing!
If I Adjust click on the icon and go through the menu system
Language -> Lua
Script -> SlashDot
Apply
- yes, it does work. But it's an awful lot of palaver. Not the simple way
I asked about.
--
Richard Torrens.
http://www.Torrens.org.uk for genealogy, natural history, wild food, walks, cats
and more!
--
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx