I have long wanted to be able to clear the post window in SCIde from the lang, but this has never been possible. I now have this working with osascript:
var clearPost = ("osascript -e 'tell application \"System Events\" to tell process \"SuperCollider\" to set frontmost to true' && osascript -e 'tell application \"System Events\" to tell process \"SuperCollider\" to keystroke \"p\" using {command down, shift down}' && osascript -e 'tell application \"SuperCollider\" to activate'");
clearPost.unixCmd;
This will return you to your gui window afterwards.
To stay in the ide:
var clearPost = ("osascript -e 'tell application \"System Events\" to tell process \"SuperCollider\" to set frontmost to true' && osascript -e 'tell application \"System Events\" to tell process \"SuperCollider\" to keystroke \"p\" using {command down, shift down}' ");
clearPost.unixCmd;
You need to add SuperCollider to macOs Settings->Privacy and Security → Accessibility, or it won’t work.
For those of you using the apple script version, you need to add SuperCollider to macOs
Settings->Privacy and Security → Accessibility, or it won’t work.
The ScIDE.clearPostWindow works on any platform that supports Qt. The applescript version is just a temporary workaround. If you build the dev version of SC, then you can have ScIDE.clearPostWindow now.