Hi - I have a JSL script that prompts the user to save a selection of JMP graphics that have just been generated by an analysis directly to a PowerPoint presentation. The user is likely to want to inspect the resulting slides immediately, so I don't want to close the PowerPoint file automatically - but if the user then tries to append any more graphics to it with a second run of the script, they'll get a JMP Alert telling them they're trying to overwrite a file that might be open in another program (which of course it is).
I've tried trapping an attempt that could fail with the Try() function, but this doesn't seem to work: the error occurs anyway - and although the JMP Alert does correctly tell the user what the problem is, I don't really want error messages interrupting the flow of the program. I thought using the "Is File Writable()" function to check it in advance would deal with it, but that doesn't seem to work either: the PowerPoint file is deemed to be writable, even though it's open.
At the moment I'm putting up a message on the screen - if the file already exists (which obviously I can check for) - warning the user in advance that if it's open, they'll need to close it before proceeding - but this is a bit inelegant and doesn't really solve the problem. Is there a way to automatically (a) check that it isn't open already, and (b) close it if necessary?