Hi, Bob
It may be easier to make an analogue of ^% G ?
Something like this:
AlterG(gn = "", Output rep) As %Status
   OPEN 2:$job USE 2
 zwrite @gn ;
 set i="",rep=""
 for set i=$order(^SPOOL($job,i),1,s) quit:i=""
  set rep=rep_s
 KILL ^SPOOL($job)

  in Studio in the Output panel you can execute COS commands.
Copy the file you need to the CSP directory. For example for Windows:

 write $zf(-1,"copy g:\readme.txt c:\InterSystems\IRIS\CSP\aaa\readme2.txt")

After editing, copy it back.

Or another way, create a new application with the file storage you need.