· Feb 25, 2016 1m read

Studio Tip - running COS Commands from Output

I wanted to share a little tidbit which is in the Studio documentation ( but many people who have been using the InterSystems Studio for a long time missed the addition of this *very* useful feature, and every time I mention this to an audience  I see at least one face light up because of how excited they are to learn about it!

Within Studio, the Output pane (View -> Output) is actually misnamed.  It is actually an Input/Output window which can be used to run Caché ObjectScript commands!  See the following example:

A very nice advantage of this is that the Caché ObjectScript is run within the context of the OS user that Caché is running as, which means that file permissions, etc are the same as a studio process (this is very helpful when using the source control hooks).

Two cavaat that I know of:

1) You can't run the Read Caché ObjectScript command from this window

2) You can't ! out to the OS like you can from a regular csession

I hope that some people have their faces light up when they read this because it is an exciting and very powerful feature that they didn't know existed :)

Discussion (7)3
Log in or sign up to continue

A few more caveats:

  • It's not that you can't use the READ command, but that the command completes immediately with emptystring, i.e. "". So beware of running certain command-line utilities. For example, if you connect Studio to %SYS and D ^LOCKTAB in the Output pane you're trapped in an endless loop and have to terminate your Studio.
  • If anything you run releases all locks with an argumentless LOCK command, any Studio locks will also be gone. I've sometimes wished COS allowed us to protect the locks of our process in the same way as we can NEW our local variables.
  • Issuing the H or HALT command is a surefire way of ending your Studion session.