How to remove the IDE window in a standalone?

Hello,

I am following the ‘Making Standalone Applications’ tutorial of the Help Browser. It does not mention how to remove the IDE window. I would like to close it, preferably before ‘booting’ the interpreter so that it never appears.

In my startup file I would like only one line to be executed:

PrecessGUI("Precess", Rect(20,20,600,700)).front;

which opens my own GUI. It is essentially a MIDI sequencer so even no need to boot the server or anything like that.

Help much appreciated - thank you!
-&apos

If you run the IDE (which is what happens when you double-click on the normal SC icon), then you have requested an editor session and of course you’re going to get an editor window. I’m not on Mac, so I’m not totally sure, but it looks to me like the standalone application guide a/ is Mac-only (so, if you’re interested in distributing your work cross-platform, do not follow the instructions in it!) and b/ seems perhaps not to bypass the editor.

I would suggest to run sclang directly, and not touch the editor at all.

Create a shell script (or a Windows batch file) with:

sclang path/to/myScript.scd

Make it executable, and then you have something you can double-click and run.

In Linux and probably Mac (not sure about Windows), the shell script has to run in a terminal window – this is where sclang posted output will appear. I don’t know how to suppress this. But, if your SC script opens a fullscreen GUI window, then the terminal window will be hidden pretty quickly.

That’s the best I know how to do.

hjh

Thnx James!,
I also found this github project that is essentially doing what you described: GitHub - dathinaios/sc_osx_standalone: A minimal SuperCollider standalone template for macOS.

The problem is that it is using supercollider 3.6, and on the bottom of the page it says that it has some issues linking to the QT libraries. Too bad making a standalone seems to be quite a hassle to do on the latest branch. I’ll see if I can build from 3.6 and merge in what I need myself (LinkClock for example).

It’s possible to package sclang so that it’s launched directly from the icon on mac. You can start from the existing SuperCollider.app package, but modify the Info.plist so that it points to the sclang executable instead - I believe some additional modifications are required to pass the right command line flags. Info.plist is pretty well documented.

This is an old branch that build a standalone sclang app package as part of the regular cmake build process. It’s very far out of date, and was not totally finished, but there are a few subtle C++ changes related to running as standalone - if you get in deep territory, these might give some clues :slight_smile:

That’s irrelevant. sclang has for years supported command-line usage as sclang path/to/script.scd and that feature has not been removed in any recent versions.

It looks like that repository is trying to jigger things around in a MacOS .app bundle – which is fine to do for that OS, but that’s separate from the question of whether you can run sclang without an editor window. You can, on all OSes, today, with all versions available for several years.

hjh

as an addendum to what James said, i’m fairly certain that, although you can invoke sclang as an executable on Windows, interactive usage (REPL) has not been available for a couple versions now.

Indeed - I had missed that. sclang.exe does not recognize any commands that are typed in.

But I just confirmed, sclang.exe path\to\script.scd does execute the script properly in Windows.

So the problem is with commandline typed input only, and you can run sclang with a prepared script in any OS.

hjh

Hi everyone,

After having a sudden increase of work while dealing with this issue (my excuses for the inactivity of this thread), I decided to contact @Dionysis, who then made the required adjustments to his project to make it run with QT!

So I can definitely recommend his method.
More here: