Re: OK Brian - weather conversion to script Question
Brian Wolven <[email protected]>
| Newsgroups | gmane.comp.windows.shells.litestep |
|---|---|
| Message-ID | <[email protected]> |
Paul wrote:
> Brian Wolven wrote:
>> Hale, Paul wrote:
>>> Hey Brian and rest of y'all. I changed all the *Alias's over to scripts,
>>> but it is not working. I have always said I suck at scripting, it's like
>>> reading goddamn latin to me. Anyways, whenever I use my script that I
>>> converted I get errors saying:
>>>
>>> Weather INI file %1 not found!
>>>
>>> or the given Search String
>>> [ ]*([%%][11]).*
>>> wasn't found in the file
>>> ...\volatile
>>> Replace canceled!
>>>
>>> yadda yadda yadda... you get the idea.
>>>
>>> Of course this is something to do with the location and the syntax
>>> pointing to my xml file.
>>>
>>> Enlightened me Sensei
>>
>> Usually when you have problems with scripts it's because they are not
>> doing what you think they are doing. So... you need to stick some
>> diagnostics in there (!alert or sumpin') to see what the script is
>> really doing. It's hard to tell you much more without seeing the
>> scripts themselves.
>
> The scripts are ultra simple. Everywhere you had an *Alias line, I broke
> it down into a multiline script.
>
> *Alias !SaveSetting !execute [!SetEvar %1 %2][!ReloadTEM][!xTextSaveEvar
> @$SettingsFile$@ @%1@ @%2@][!UnloadTEM]
>
> became
>
> *Script bang !savesetting
> *scriptexec !SetEvar %1 %2
> *sciptexec !ReloadTEM
> *sciptexec !xTextSaveEvar @$SettingsFile$@ @%1@ @%2@
> *sciptexec !UnloadTEM
> *script ~bang
>
>
> This is the part where everyone has a good chuckle and tells me you
> can't do this.
Hehe - you can't do that. =P
The "%1" and "%2" are the way that the arguments to the alias module are
tokenized. Mzscript syntax is different (%{\1}, %{\2}, at least for certain
versions), so for starters you'd need to change all of those. Something like
this *might* work:
*Script bang !savesetting
*scriptexec !SetEvar %{\1} %{\2}
*sciptexec !ReloadTEM
*sciptexec !xTextSaveEvar @$SettingsFile$@ @%{\1}@ @%{\2}@
*sciptexec !UnloadTEM
*script ~bang
Look at all the other translated aliases: lather, rinse, repeat. YMMV.
---------------------------------------------------------------------
Can't Unsubscribe? Check http://desktopian.org/listunsub.html
LS List Homepage: http://wuzzle.org/list/litestep.php
Get the LS FAQ: http://lsfaq.shellfront.org