mzScript and TextReplace2 Thread last updated on 2003-09-30 08:03:30

Posted by member 700 on 2003-09-26 17:48:37

I am trying to use mzScript and TextReplace to make my taskbar center properly at the bottom of the screen. My code as of the moment looks like this:
*Script bang !TaskbarSetup
*Script exec !varSet TaskBarPosX %[xresolution]
*Script exec !varMul TaskBarPosX .5
*Script exec !varAdd TaskBarPosX -320
*Script exec !textreplace "step.rc" "TaskBarX" "TaskBarX %[TaskBarPosX]"
*Script ~bang


My problem is that I need to preform a refresh to get the variables to pass into the Step.rc file. Can someone help me with this cause I can't for the life of me get it to work. I've tried putting a *Script exec !Refresh inside there but it keeps running it over and over again and finally crashes. Anyone give me any input on this?

Posted by member 1 on 2003-09-26 17:58:07 link

Should be in the bang def like you had it...but your textreplace line looks bunk.

Posted by member 700 on 2003-09-26 18:10:37 link

When I do a !Refresh it takes about 15 seconds, and then crashes.
I changed the !textreplace lines to the newer syntax, all the " are repaced with @, and still crashes.

Posted by member 1 on 2003-09-26 18:24:50 link

here is one of my lines...maybe you will see the issue...

*Script exec !textreplace "$ConfigDir$\setup.rc" "Position1 *" "Position1 %{setting1}"

Posted by member 700 on 2003-09-26 18:51:06 link

Trying this:
*Script bang !TaskbarSetup
*Script exec !varSet TaskBarPosX %{xresolution}
*Script exec !varMul TaskBarPosX .5
*Script exec !varAdd TaskBarPosX -320
*Script exec !textreplace "step.rc" "TaskBarX" "TaskBarX %{TaskBarPosX}"
*Script ~bang

But to no avail, still crashes after a !Refresh

Posted by member 36955 on 2003-09-26 19:18:54 link

well... first of all, cant you just use TaskbarX -320c in the step.rc to get the same results?
but for this code to work, do this:
*Script exec !textreplace "$ThemeDir$step.rc" "^TaskbarX .*" "TaskbarX %{TaskBarPosX}"

assuming $ThemeDir$ is where your step.rc is... if you are using ots, it should be

Posted by member 37809 on 2003-09-26 19:30:15 link

You could accomplish the same using just this, though I'm not sure if it's what you want:
TaskbarX $ResolutionX/2-320$

But to 'be dynamic' as in your post, after editing step.rc, you can use !reload to reload step.rc. If then you need modules to use the updated settings, you can use !reloadmodule <path-to-module>.

!refresh has always been a source of erratic behavior and inconsistency for me, since not all modules handle it [the same].

Posted by member 36955 on 2003-09-26 19:59:52 link

are coordinates like -320c supported by litestep itself, or are they specific to modules?

Posted by member 700 on 2003-09-26 20:26:48 link

Thanks everyone! Got it figured out.

Doy, that works perfectly, thanks for the syntax help there.

tnl, thanks, that works great too. Thanks for the pointer on !reloadmodule.. I didn't know you could do that.

Posted by member 7 on 2003-09-30 08:03:30 link

doy: They are supported by modules that use GetRCCoordinate instead of GetRCInt to retrieve the setting's value. GetRCCoordinate is the same as GetRCInt plus 'c' and '%' support.