I want to run FrameMaker from a shell script under MacOS. No: I do not want to say "open foo.fm" from my shell script. I know how to do that, that works, and it is not what I want to do. Or, perhaps it IS what I want to do, if I can make it "special" in the following way: I want to set a Windows environment variable, to a value that is specified as an argument to my shell script, and then invoke FrameMaker. Reason: I already have code, running on Cygwin, that does this. I have FrameMaker ExtendScript startup code that looks for this environment variable, and uses it to determine what special operations to do. Using this technique I have written scripts that do things like convert FrameMaker versions, save as text, regenerate books, etc. Basically, I can automate anything that ExtendScript knows how to do. I do things this way - setting an environment variable - because FrameMaker does not seem to have a way for ExtendScript to parse the command line. Using an environment variable is not unlike writing some text into a file, and then having ExtendScript open that and parse it - except that writing into a globally known file is likely to run into contention bugs when several instances of Framemaker are running in this way, whereas the environment variable (or vommand line parsing, if it were available) is private to a process, and so does not have this sort of race condition. I.r. writing commands to a single globally known file and then executing that is buggy; but I will fall back to that if I have to. Still, it would be sad if Parallels forced me to run FrameMaker in a bug-prone way, in a way that I already know how to avoid in Cygwin and other virtual machine packages. Therefore, "open foo.fm" does not meet my needs - since it does not give me a way to set a Windows environment variable. (Hmm, I wonder - perhaps I could create a fake filename like "open fake_filename=scriptfile.fm", and have my ExtendScript parse the fake filename and extract a real filename from that. Ugly, but it might work. Still, would be a pity if Parallels forced me to such an ugly kluge.) Now, prlctl exec would seem to be what I want. (Apart from problems like http://stackoverflow.com/questions/33192114/problems-with-prlctl-exec-inside-emacs-shell-mode-window) But, try as I might, I have not been able to get prtlctl exec, or its cousin prlctl enter, to start up FrameMaker. I have been able to get prlctl exec/enter to start up many DOS like commands, like ipconfig. I have been been able to run cygwin bash on windows using prlctl from macos. I was hoping that this might give me a way of running my existing cygwin shel scripts that know how to automate framemaker. But so far, try as I might, I cannot get any of the prctl exec/enter approaches to start FrameMaker. Even when prlctl exec runs a bash script, that runs FrameMaker correctly from a "normal" Windows environment. For that matter, I have not been able to get prlctl to run any other GUI command. prlctl can run text mode apps, like ipconfig or bash, but nothing GUI, as far as I can tell. If some reader has a prlctl command that can start FrameMaker, please tell me. But failing that, I would appreciate an example of using prtlctl exec to start any significant GUI app, like Word or PowerPoint. Or even Notepad. None of these seem to be working for me.
<<perhaps I could create a fake filename like "open fake_filename=scriptfile.fm">> 1) would solve the simultaneous race problems 2) does not work because "open" complains when the file does not already exist - does not allow creating a new file 3) even if it could make it work, would be a security hole waiting to happen - imagine phishing email