Author Topic: How to capture a filename passed to a WPS program start object?  (Read 213 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1525
  • Karma: +43/-0
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.
« Last Edit: May 24, 2026, 05:00:34 am by Dariusz Piatkowski »

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1191
  • Karma: +38/-0
    • Blonde Guy
Re: How to capture a filename passed to a WPS program start object?
« Reply #1 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.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1525
  • Karma: +43/-0
Re: How to capture a filename passed to a WPS program start object?
« Reply #2 on: May 28, 2026, 03:44:37 am »
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!