VLC helper protocol on Mac OS X - macos

I am trying to add a vlc:// helper protocol on Mac OS X. To register the protocol, I have unsuccessfully been playing around with the MoreInternet PrefPane.
What I want to have in my browser is a vlc://someressource.com/audio.mp3, which should launch VLC and add http://someressource.com/audio.mp3 to the playlist (this works fine on Windows and also Linux if I remember correctly). Maybe even just have vlc://http:// so that https would also be supported.
I have no idea how to achieve this. I tried making a bash script, which MoreInternet would not accept. Then I tried making an application through Automator with my Bash script embedded. That did not work either, as the Automator application has no "creator code" - whatever that is?!
Can any of you guys point me in the right direction?
Thanks in advance!

It looks like MoreInternet hasn't been updated since 2006, so I wouldn't count on it working well.
A creator code is a unique 4-character code assigned to applications, before bundle IDs were invented. If you want one, register a code and then put it in your Info.plist under the CFBundleSignature key.
Rather than using MoreInternet, it may suffice to declare your app as a URL handler in your Info.plist, under CFBundleURLTypes. Ideally, VLC.app would do that.

Related

Create "Screen" like command in macOS application

I am trying to create a screen like function that would be used in terminal but in a macOS application where the user can send and receive data to a /dev/cu.usbmodem*.
*I am doing this in a macOS application and not a Command Line tool because I need to be able to access cloudKit easily.
I haven't found much of any info on this? IDK if it matters but I could code c, c++, or Swift file if that makes this possible.
Is this a possibility?*
I've tried to use the SerialSample program on Apple's Developer site but haven't been able to get the data back that would receive in a terminal screen. It does connect to the usbmodem and at the correct baud rate but the data is incorrect. This is most likely an error in my usage so I will also listen to suggestions for that method if it's the only way to achieve my above goal.

Is there a WinAPI way to detect remote applications like LogMeIn?

Years ago, there were functions in Win32 whereby the app could check to see if a user was running the app via Terminal Services/Remote Desktop. I thnk it was something like:
GetSystemMetrics(1000H)
Is there a system call one can make to check to see if a Win32 or Win64 app is being run remotely via a program like GotoMyPC or LogMeIn?
No, there is not. Those are third party apps doing their own video/input capturing and network streaming. They are plain ordinary apps as far as Windows is concerned. Terminal Services is built into Windows, which is why there are APIs to query TS status.
The only way I can (currently) think of, other than using the aforementioned API call, is also seeing if any particular processes you can identify are running (e.g. GotoMyPC or LogMeIn... they will have some process running). Without doing too much research, they may be running without actually having someone using them. If, however, they launch something to do the streaming, you could check for that.
Just to make sure that this isn't an XY problem, what is it that you're trying to do - and perhaps there is another way?

Mac SDL+OpenGL App refuses to launch from anything but terminal

We've got a fairly mature cross-platform game engine which we've had running on OSX for several years now without a hitch; we recently upgraded the game from SDL 1.2.15 to 2.0, and at some point in the conversion, I goofed something up and now we have a bizarre problem where the app launches just fine from the terminal, but when you launch the app from a double-click in the Finder, it just bounces once in the dock and just goes away.
We're baffled because insofar as I can tell, there's only a one-liner being printed in Console.app: Exited with code: 255 (naturally running from the terminal doesn't help here because we can't reproduce the problem there; the app runs fine when launched in a terminal).
So the only thing we can figure is it's either something we're goofing up in our main.cpp, or something we've hosed in how I set up the dylibs/frameworks. It's also possible that it's something to do with the working directory not being set right, but to the best of my abilities, I believe we're doing it right (regardless of your current working directory; the app attempts to forcibly set said directory to be in the Resources folder - this was necessary to get the game to launch, but I don't know if we're doing it wrong). This feels like a somewhat awkward fit for stackoverflow, for which I apologize, since it's not a simple "paste this code and ask what's wrong" job. I have two ways for you to reproduce it; firstly we are an open-source project, and you can get our source code (complete with a mac project file and all dependencies included in the repo, set up and ready-to-go exactly as I've perhaps erroneously created them), at our github page. The one change you'll need to do is open a file at the root level, named master-config.cfg, and remove the // comments from it (so the engine knows you want to launch a simple demo game shipped with the engine).
Alternately, I have a stripped down (~15mb zipped) binary you can directly download and try to run, if that's sufficient to diagnose the problem.
As said before, we're open-source, so we welcome any pull-requests for fixes!
You need to write a minimal Cocoa wrapper so that OS X will not SIGKILL you for not launching properly. I will give you a pull request with that wrapper.

How can I convince OS X to open txmt:// URLs in MacVim?

I guess there's not much else to the question. OS X 10.5.
If possible, use the mvim://-protocol instead. It should be compatible with the txmt://-protocol.
If you are not able to change the links themselves, you could try editing the Info.plist for MacVim.
I do not know whether plugin for this «protocol» already exists, but if you want to write your own, you should take a look at BufReadCmd event (and also BufWriteCmd). If you don't want to start from scratch, some such events are defined in $VIMRUNTIME/plugin/netrwPlugin.vim (for example, for ftp:// protocol) file which should come with your vim installation.

Open Default browser with Mono+gtk#

I need to open an url from my application, on both linux and windows and i want to avoid replacing an existing page on an open browser.
How do i call for it to open?
I know i can use
System.Diagnostics.Process.Start("http://mysite.com");
which should also work under linux, but this will replace any page shown on an already open browser window.
i found this article ( thx to Nissan Fan):
System.Diagnostics.Process.Start("http://mysite.com");
but this only works for windows and i need a solution that will work on both systems.
I think this is what you want:
System.Diagnostics.Process.Start ("xdg-open http://mysite.com");
This will only work on linux, but should work for all linux desktops. Like grombeestje said, you should probably implement it separately for Windows and linux.
i would suggest to check on what OS the app is running, and then implement it for each OS separately.
After searching through the Banshee source code I see that they use Gnome.Url.Show() (In gnome-sharp) to open the users default browser.
If that isn't possible for whatever reason, a couple of other ideas come to mind.
If the user is running Gnome there should be a program called "gnome-open" that should do the trick.
System.Diagnostics.Process.Start("gnome-open http://mysite.com");
And if that doesn't work I know that (at least) all Debian-based systems come with a script called sensible-browser.
System.Diagnostics.Process.Start("sensible-browser http://mysite.com");

Resources