sveinbjornt / Platypus

Create native Mac applications from command line scripts.
https://sveinbjorn.org/platypus
BSD 3-Clause "New" or "Revised" License
2.84k stars 171 forks source link

Create a default browser? #253

Closed dzg closed 1 year ago

dzg commented 1 year ago

I'm trying to use Platypus to make an app from this AppleScript:

on open location theURL
    tell application "Google Chrome"
        make new window
        activate
        set URL of active tab of first window to theURL
    end tell
end open location

... which I want to make the "Default Web Browser"...

image

... so that when I open a link outside of Chrome, it opens in a New Window.

So I followed the instructions at https://stackoverflow.com/questions/42605571/how-to-register-a-python-script-with-mac-osx-as-a-web-browser ...

image

but not sure what to put for URI scheme. I tried http but after running, it did NOT show up as possible default browser.

gingerbeardman commented 1 year ago

I can't help with this, but I use Default Browser app to take care of this issue for me. https://defaultbrowser.app

dzg commented 1 year ago

@gingerbeardman Thanks – but that does not allow to force a new window AFAICT (which is my whole purpose here)

gingerbeardman commented 1 year ago

Ah, I see now, apologies.

So every link from outside of Chrome will open in its own window?

gingerbeardman commented 1 year ago

@dzg Here is how I managed to register a Platypus app as a browser: Browsy.platypus.zip

Screen shot 2023-05-24 at 22 02 36

I have not tested whether the AppleScript you're using works.

After running the newly created Browsy.app a couple of times... Here is the new app showing up in Default Browser.app so we know it has worked.

Screen shot 2023-05-24 at 22 02 02