|
Post by Stefan on May 3, 2019 13:38:22 GMT -5
Hi Guys, I seem to recall that ISPF/PDF offered the option (can't remember what they called it) to execute an initial macro before showing the file being edited to the user. I cannot recall if it was just a field on the panel where we specified the name of the dataset to edit, or if it was a setting in the file type Profile. Question is... does SPFLite offer a way to open a file for editing and immediately running a specified Macro? If so how? BUT.... IDEALLY...
I'd like a macro option on the SPFLite start parameters. That way, we could harness the extensive editing and data manipulation capabilities of SPFLite from other sources, e.g. 1. Application (A) creates a file and starts SPFLite specifying the file-name and the macro-name. 2. SPFlite opens the file, and initiates the macro to perform its magic. 3. The macro SAVEs the file back and finishes (or terminates SPFLite) 4. SPFLite terminates 5. Application (A) regains control and reaps the results
Any chance?
Thanks for a great product.
|
|
|
Post by George on May 4, 2019 10:22:34 GMT -5
Stefan: What you remember was called IMACRO, and I remember it being part of the file Profile. I don't think it would be too hard to provide it as part of a Profile (famous last words).
Doing it via the command line is also probably do-able (again, to be proven)
Comments from other users?
George
|
|
|
Post by George on May 4, 2019 17:33:47 GMT -5
If an iMacro went bonkers, just PROF EDIT xxxx and remove the IMACRO from the Profile. If I remember when I used ISPF IMACRO, they rarely did much of anything. Mine just did a RESET of some kind because ISPF liked to come up and warn me every time that my ASM files had lowercase letters (comments) in them. I just got tired of being nagged.
George
|
|
|
Post by mueh on May 5, 2019 2:30:45 GMT -5
Hi George, Stefan ! I use a Thinbasic Script which uses SendString to execute Keystrokes in SPFlite. As and example for an CMD to exclude first and last line against a view of a file . MUENT.exe is the Bundled exe of MUENT.tbasic Line 33 starts the Desktop LNK file which is in my case "SPFLite Editor 10.2" which you must Change or you create a copy with that name . first parm is the SPFLite(v10.2 Title which is used to find the Window . second parm are the keys executed in that window . MUENT.exe SPF(v10.2 "view K:\MB\LIPK{ENT}{HOME}{ESC}x .ZF;x .ZL{ENT}" Here the exe and tbasic script MUENT.tbasic (12.72 KB) MUENT.exe (512.5 KB) Enjoy excuting cmd's f.e Setting complicated file Patterns in FM MUENT.exe SPF(v10.2 "{HOME}{ESC}swap home{ENT}{ESC}{BS}{TAB}S{ENT}{BS}{BS}%temp%\MUSUB{ESC}{BS}*.dasd.*.3x?.?;*.MVSRES.3x?.?{ESC}{ENT}"
|
|
|
Post by George on May 5, 2019 10:45:02 GMT -5
MUEH: I'm impressed at how determined you've been to get all this stuff working. I'm lazy (ask Robert!) and tend to 'live with' stuff until it REALLY ticks me off.
George
==> And you thought *I* was crazy :-) - R
|
|
|
Post by Jo on May 8, 2019 4:20:43 GMT -5
Yes, IMACRO would be great.
|
|
|
Post by George on May 8, 2019 9:41:40 GMT -5
MUEH: Jo: Robert:
I've been 'toying' with this using some "quick & dirty" code chunks. IMACRO seems to be a 'for sure' item, not too hard.
But I tried to create a -MACRO xxx command line option to allow starting SPFLite with a macro against a file
e.g. SPFLite.exe -MACRO MACNAME MyData.txt
And it works fine, but any output message from the macro (via HALT) does not show up on the message line until AFTER the next Enter is done. And the problem turns out to be that the macro is actually executing BEFORE the SPFLite window actually appears. And there's no way I can find to get around this.
So, IMACRO looks good, a command line -MACRO is OK, but no message (right now). Not sure if that's a 'livable with' type restriction. Not even sure how much use a -MACRO command line argument would get.
George
|
|
|
Post by mueh on May 8, 2019 10:51:06 GMT -5
George: IF -MACRO "do dofile" is accepted it would be usefull . Thanks
|
|
|
Post by George on May 8, 2019 13:39:06 GMT -5
Robert: I can't get too tricky with the syntax on the command line. In your example, MACNAME is obviously the macro name, but what's the filename (remember it can have embedded spaces. Which would mean getting into quoted strings within quoted strings. Also we would have to reassemble the one two three from the rear of the command to make MACNAME one two three. It gets messy fast.
Internally, everything has to be packaged and passed as parameters to the Edit/Browse/View command processor since, as I said, we don't even have a Window yet, let alone Tabs to pass things to. It's all happening during the startup bootstrapping process, a lot of supporting routines can't be used (yet).
MUEH: I'll look at maybe kicking off DO processing. Maybe using DO could solve some of these timing issues. Things to ponder.
George
|
|
|
Post by George on May 9, 2019 10:18:10 GMT -5
Robert: It's startup time, keep saying that. OK, so I have "MACNAME MyData.txt one two three"
All I have to do is launch the macro MACNAME and pass it arguments. Great! - - - Where? I have no window, I have no Edit tab open. I can't even launch it in FM since that's not up and running yet. It really is tough to do this, NONE of the normal environment exists yet.
George
|
|
|
Post by Stefan on May 11, 2019 8:11:55 GMT -5
Hi Guys,
I'd be quite happy to just have an IMACRO setting added to the PROFILE. SPFLite already allows a filename to be specified on startup which is then opened in EDIT. As Robert says above, we just need to give the filename an extension/filetype that matches to the correct profile and the IMACRO would execute. Pretty simple solution that avoids all the timing issues that come with SPFLite startup processing.
BUT... To allow SPFLite to be called as a data manipulation tool, we still need a way to terminate it at the end of the IMACRO. I note that SPF_CMD("EXIT") and SPF_CMD("END") are not functional. Quite understandable, given the possible repercussions to other open ISPFLite tabs. To mitigate against accidents, perhaps a new command like "TERMINATE" could be added to effectively do what happens when you type "EXIT" on the command line of any open EDIT tab.
What say you?
|
|
|
Post by George on May 13, 2019 12:25:42 GMT -5
Status update on all this.
As I thought, a Profile level IMACRO was simple, I have it working. Currently it is only settable via the PROF EDIT dialog, should it have a command-line IMACRO version?
The other flavor (an EXE -MACRO xxxx operand) has proven to be a no-go due to startup timing issues.
However, I can provide a -DO xxxx operand to run a DO macro at startup. Limitations - The DO macro is launched in the FM tab regardless of what other tabs may have been opened. Maybe I could get it moved into another tab (assuming there were others), but where/how would that be specified?
George
|
|
|
Post by George on May 13, 2019 12:37:16 GMT -5
Stefan: Re: Termination.
I tried the following (my test version, this won't work for you -- yet)
I opened up the DO command and allowed it to be issued by a macro.
Created a TERMINATE.DO containing
(Home)(EraseEOL)[=x](Enter)
And a test macro
' TRY.macro
SPF_CMD("DO Terminate")
And it works just fine. So, yes, you will be able to terminate SPFLite from within a macro. As long as there are no prompts generated (like Do you want to save ...) then it should work fine.
George
|
|
|
Post by George on May 14, 2019 9:20:28 GMT -5
Robert: The -DO xxx simply invoked the xxx.DO macro, so you can do whatever a DO macro supports, which is everything but be programmable. DO macros are just glorified keyboard macros.
So if it starts in the FM screen, what could you type in at that point?
Although -TAB could do it, I'm still not clear just how much demand there is for this extensive command line support. I suspect we could count the users who would use it on 1 hand.
Users? Please comment.
George
|
|
|
Post by George on May 14, 2019 12:27:06 GMT -5
Robert: I suspect the single file usage is whats desired. I think the idea is to invoke SPFLite for a single file and run some macro against the file and then terminate the whole thing. i.e. they want to SHELL out of another program to run SPFLite and have it return back to them to continue on.
Not necessarily a bad idea, it would be simpler since we could make some assumptions.
George
|
|