Learning textedit2 Thread last updated on 2003-10-27 15:35:19

Posted by member 20409 on 2003-10-27 12:17:09

I'm learning more and more, but I'm trying to branch out and make my theme a little more dynamic. I've run into a problem with the syntax of textedit2. I'm trying to replace this:
*taskswrapcmd 1, !makesmall
with:
*taskswrapcmd 1, !makemedium
I've read the docs, and learned that the * needs to have the \ in front, and the bang is made with \^. Just can't seem to get it right though.
Much thanks to all.

Posted by member 37809 on 2003-10-27 12:40:38 link

To be lazy, you could get away with !textreplace'ing an evar and use it like so:
sizeOrSomeBetterName small
*taskswrapcmd 1, !make$sizeOrSomeBetterName$

For exact syntax it may depend on which version of textedit. Read up on regular expressions in its docs and elsewhere to understand it. I think this should work though (all one line):
!textreplace "$ConfigDir$somefile.rc" "^(\*taskswrapcmd 1, \^make).*" "\1SOMETHING" ; where SOMETHING is small or medium

Posted by member 20409 on 2003-10-27 15:35:19 link

Whew, I guess I didn't know what I was getting into when I started trying to learn scripting and textedit2. I'm using 2.52, the latest on shellfront's module list. I'll give it a shot though. I'm not much of a coder, I dropped out of C++ after a few months and never wanted to go there again. Thanks.
I guess my main promlem was with the ,1 part. For some reason, it wasn't writing it right.

And I love the "lazy" idea. That's probably what I'll end up using. Better to make it simple.