View unanswered posts | View active topics It is currently Thu Apr 23, 2026 4:04 am



Reply to topic  [ 4 posts ] 
 Adding buttons to Swath to do stuff like edit the Swath.cfg 
Author Message
Ensign
User avatar

Joined: Tue Jul 21, 2009 2:37 pm
Posts: 241
Location: Ottawa, Canada
Unread post 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.


Mon Oct 05, 2009 1:14 pm
Profile
Ambassador
User avatar

Joined: Wed Nov 12, 2008 8:57 am
Posts: 3554
Location: Long Beach, CA
Unread post 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

_________________
Helix
Do I really look like a guy with a plan? You know what I am? I'm a dog chasing cars.
Lest we forget
I had to ask myself WWSGD?


Mon Oct 05, 2009 9:03 pm
Profile WWW
Ensign
User avatar

Joined: Tue Jul 21, 2009 2:37 pm
Posts: 241
Location: Ottawa, Canada
Unread post 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.


Tue Oct 06, 2009 8:33 am
Profile
Ensign
User avatar

Joined: Tue Jul 21, 2009 2:37 pm
Posts: 241
Location: Ottawa, Canada
Unread post 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.


Tue Oct 06, 2009 10:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.