How to capture a filename passed to a WPS program start object?

Started by Dariusz Piatkowski, May 24, 2026, 04:56:56 AM

Previous topic - Next topic

Dariusz Piatkowski

So here is the scenario: I am opening a file (PDF) through a WPS object (so a standard 'double-click' on a PDF file applies here that would call the program object), and that WPS program object invokes a REXX script and/or CMD file...so how can I reference the passed filename (that PDF file I double clicked on) within that REXX/CMD file?

Is it as simple as doing 'parse arg filename' within the REXX/CMD script?

...and NO, I haven't tried any of these yet, I figured I would ask here instead of trying 10 different 'trial&error' attempts! lol

Thanks!

EDIT
====

BTW - In this case, I actually want the fully qualified filename, so drive, path & filename as I need to copy this PDF to another place.

Neil Waldhauer

I attached a short Rexx cmd file. put it some place, and drop WPS objects on it to show what WPS will give your Rexx program.
Retired consultant for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dariusz Piatkowski

Quote from: Neil Waldhauer on May 24, 2026, 03:26:47 PM
I attached a short Rexx cmd file. put it some place, and drop WPS objects on it to show what WPS will give your Rexx program.

Thanks Neil, this did the trick!