| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Adding buttons to Swath to do stuff like edit the Swath.cfg https://mail.black-squirrel.com/viewtopic.php?f=15&t=23622 |
Page 1 of 1 |
| Author: | Hotblack Desiato [ Mon Oct 05, 2009 1:14 pm ] |
| Post subject: | Adding buttons to Swath to do stuff like edit the Swath.cfg |
The below comes from a derailed Smack Talk thread. I'm re-posting it here in case anyone might find it useful. Helix wrote: Any chance of adding a button or a menu item that would let you edit and save the SWATH.cfg in the next release? Helix Hotblack Desiato wrote: This should is easy to do using zoc: Code: Call Zocshell "Notepad.exe C:\Documents and Settings\All Users\Application Data\SWATH\SWATH.cfg", 1 exit Steps to implement: 1. Copy/paste the above two lines of code to a new text file. 2. Save the file as c:\zocScripts\SwathCFG.zrx - make sure your editor doesn't add '.txt' to the end of the filename. 3. In Swath, configure zoc script directory to c:\zocScripts (Edit->Preferences->Scripts->Page1 or Page2) 4. In Swath, choose menu item Scripts -> Script Tools -> Reload All Scripts. 5. In Swath, hit Alt-X to bring up the trigger list. 6. Add Trigger... select radio 'User button pressed:', then select desired letter from dropdown (the rest of these instructions assume you selected the letter 'A'). 7. Select Radio 'Execute script / cmd'; select 'Rexx' from dropdown, select [Scr]SwathCfg.zrx from second dropdown. 8. Hit OK Hit the 'A' button to edit Swath.cfg using note pad. If you don't have an 'A' button, go to menu View -> Toolbars and make sure 'User' is checked. Congratulations on implementing your new Swath button! Note: It might not be necessary to use a zoc script. There is probably an even easier way. |
|
| Author: | Helix [ Mon Oct 05, 2009 9:03 pm ] |
| Post subject: | Re: Adding buttons to Swath to do stuff like edit the Swath.cfg |
Notepad.exe C:\Documents and Settings\All Users\Application Data\SWATH\SWATH.cfg works pretty good. But it is still outside the program, if you are running multiple copies of swath its a problem because to save the config file, close a copy of swath, it writes the cfg file. Edit the .cfg file and close a second swath, the second swath overwrites your changes to the .cfg file. So the only way I know of to save an edited swath.cfg, is to edit it with swath completely closed. Helix |
|
| Author: | Hotblack Desiato [ Tue Oct 06, 2009 8:33 am ] |
| Post subject: | Re: Adding buttons to Swath to do stuff like edit the Swath.cfg |
Helix wrote: So the only way I know of to save an edited swath.cfg, is to edit it with swath completely closed. Helix Almost.... it should work with just one swath open. But yes, running multiple swath is a problem... you'd have to close all except one, I think. Actually.... this could probably stand some experimentation. 'Cus I tested it with one swath open, by hitting the 'A' button, editing a macro, then saving notepad. The macro wasn't changed right away in the macro menu, but when I loaded the macro list it was changed. So I think this probably means Swath reads the cfg file at certain events, probably including opening macro list (alt-z) and loading trigger list (alt-x). So, possibly, with multiple swaths open, after saving the notepad Swath.cfg file you can hit alt-z then ok in each swath instance, and maybe that would load the new config. Then, no problems right? Worth a try anyway. Even if that works, it would prolly be difficult to automate the multiple swath situation. |
|
| Author: | Hotblack Desiato [ Tue Oct 06, 2009 10:31 am ] |
| Post subject: | Re: Adding buttons to Swath to do stuff like edit the Swath.cfg |
Okay I just tried it out, and it seems to work fine - just gotta remember to open trigger list in every swath after saving Swath.cfg. |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|