Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 10, 2016, 02:58:41 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: CHS and REXX  (Read 2273 times)

krcc18a

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
CHS and REXX
« on: May 13, 2013, 07:37:55 AM »
CHS looks like a superb tool.

1. Can I use REXX as a Custom Script tool?

2. Which version of REXX?

3. What are the arguments? What are input and output parameters?

4. Which REXX statements would I use to read and write to the clipboard?

Thanks,
Marty

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 679
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: CHS and REXX
« Reply #1 on: May 13, 2013, 08:06:53 PM »
FWIW I always prefer Regina REXX for scripting (although I am not a CHS user and don't know how it interacts).  It's just an executable, plus a library file or two, no installation required.

Do you have a preferred flavor of REXX?
vi vi vi - editor of the beast

krcc18a

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: CHS and REXX
« Reply #2 on: May 13, 2013, 10:40:14 PM »
Regina REXX suits me fine, but I still couldn't figure out:

1. What are the arguments? What are input and output parameters?

2. Which REXX statements would I use to read and write to the clipboard?

Thanks,
Marty

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,431
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: CHS and REXX
« Reply #3 on: May 13, 2013, 10:55:54 PM »
The place that you would interface a custom script is on the "Custom Script Tool" tab page of the Modify Format option:
S5_13_2013 , 10_50_29 PM.png

After you configure your tool, use the Presets menu and choose Save As to save it.  You can even set a custom hotkey from the "Preset Hotkey Trigger" tab before saving.

The key to understanding how to use custom tools/scripts with CHS is to see from that dialog that CHS will first save the clipboard text to a file, and then pass that file as an argument to the script, and then expect the script to either save changes to that same file, or to a different file or output it to stdout.

So what you need to do to use REXX or any other scripting tool, is test calling your tool from a dos commandline.  Some scripting languages will let you call them directly like "myscript.py %infile%" but others may require you to call them with the full path to the interpreter like "C:\Python.exe myscript.py %infile%".

Then just test your script from the commandline until it does what you want.

There are some sample tools in the Tools\ directory of CHS to help you see how a tool should behave.

krcc18a

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: CHS and REXX
« Reply #4 on: May 17, 2013, 07:36:39 AM »
Thanks all!

I got this working.

1. I had to specify the complete path to the Regina Rexx product and the REXX exec in a .bat which I had pointed the CHS Custom Script Tool menu to.

2. I took the take the defaults of:

create %infile%

and

read from %outfile%.

which were read and written to by Regina's linein and call lineout functions.

Thanks,
Marty

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,431
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: CHS and REXX
« Reply #5 on: May 17, 2013, 07:38:58 AM »
Nice work !  :Thmbsup:

Rover

  • Master of Smilies
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 630
    • View Profile
    • Donate to Member
Re: CHS and REXX
« Reply #6 on: May 17, 2013, 10:38:40 PM »
@OP:  OMG, I haven't thought about REXX since early 2000's.  ;D  It was cool because it ran on OS/2, Windows, *nix and System 390. 

It was "cooler" than perl because it was less obfuscated.

That's cool as hell you got it working with CHS.   :P

 :o  You're not running eCom Station are u?   :tellme:  That would be way too funny.  :D
Insert Brilliant Sig line here

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,141
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: CHS and REXX
« Reply #7 on: May 18, 2013, 10:03:57 AM »
@OP:  OMG, I haven't thought about REXX since early 2000's.  ;D  It was cool because it ran on OS/2, Windows, *nix and System 390. 
It was "cooler" than perl because it was less obfuscated.
That's cool as hell you got it working with CHS.   :P
 :o  You're not running eCom Station are u?   :tellme:  That would be way too funny.  :D

REXX redux?     ;)
REXX seems to have been mentioned on and off in the DCF for years. If you did a search on the forum for "REXX", you'd get 2 pages worth of references to it.
A great and still useful scripting language, it seems.
Now compare this with a search for something more obscure on DCF - (say) the fading star Algol - and you get 3 hits.