I am using String.openOS with URL strings to help the user open specific web pages in the default browser. This works fine on Windows, but on Macs nothing happens. Presumably my MacOS or Mac browser needs to be told to permit this. Does anyone know where to look?
I’m on Sequoia, MacOS 15.7.2 and SuperCollider 3.14.1. Tried with both Safari and Firefox as default browser, same non-result.
If I invoke myURLstring.openOS in the Command window (Cmd-E), the string is posted as the return value (a String object) in the Post window.
If I invoke the same thing in my code, nothing happens.
If I invoke [“open”, “http://example.com”].unixCmd from the Command window, an integer (a process ID?) is posted in the Post window, but nothing else happens.
If I invoke open “http://example.com” in a terminal shell, it works. Which is essentially what .openOS should be doing, I thought…
Any ideas?
I could not reproduce the issue with SC 3.14.1 and Firefox set as the default browser on macOS 15.7.2 (M1 Max). Could you record your actions and the SC output using QuickTime’s “New Screen Recording”?
Found it! At the start of my program, I add Platform.resourceDir to the start of the PATH in the environment. But the path delimiter character is different on Windows ($;) and Mac ($:), so the usual bin directories were not parsed from the Mac PATH. So the open shell command was not found. Problem solved.
Embarrassing though, that I have forgotten why I am adding Platform.resourceDir to the PATH - maybe there is no good reason to do that.