Page 1 of 1
Launch URL with Any Browser
Posted: 24 Mar 2022 21:34
by TestMeister
- Chrome is my default browser so when I save a URL to a file folder, it creates a Chrome shortcut
- I frequently am working among multiple web sites and to keep things organized, use multiple browsers.
- I often save URLs in a file folder associated with the project I am working on
- I would like to be able to open a URL with Chrome, Edge or Firefox
The "Send to" doesn't work as it tries to send the entire shortcut to the browser which is what Windows File Explorer does.
Is there a way to format a URL, perhaps in a text file, so XY will process it?[/list]
Alternatively, can the "Open With" "Custom File Associations" be configured to show multiple browsers?
Re: Launch URL with Any Browser
Posted: 24 Mar 2022 21:45
by highend
Create a script that reads the url file (it's nothing more than an .ini) and then uses popupmenu() to show a list of your browsers to open the url and put that in your CFA list. The same would work for the "Open With" part of the CFA list...
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 06:34
by TestMeister
Thanks for the tip but my skill at scripts is very weak.
However, it looks like the XY Custom File Associations almost does it as the browsers are now listed in the "Open with" dialogue.
It works for Firefox, but oddly, defining Chrome and Edge the same way, it sends the shortcut not the URL.
However, all three are properly parsed with the Windows File Explorer
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 07:47
by highend
Code: Select all
$url = getkey("URL", "InternetShortcut", <curitem>);
end (!$url), "No URL found in:" . <crlf 2> . quote(<curitem>);
$browsers = <<<>>>
Vivaldi|D:\Tools\Vivaldi_x64\Vivaldi [Portable].exe|D:\Tools\Vivaldi_x64\Vivaldi [Portable].exe
Opera|D:\Tools\Opera\Opera [Portable].exe|D:\Tools\Opera\Opera [Portable].exe
>>>;
$browser = popupmenu($browsers, 6:=<crlf>, 7:="|");
if ($browser) {
run lax("$browser" $url);
}
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 17:51
by TestMeister
Thanks, very kind of you!
I expect this won't work from a toolbar button, where do I define this?
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 17:58
by highend
It works everywhere (button, catalog, ...).
Use it as a CFA^^
"Open url file" url>::load "Launch url with any browser.xys";
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 18:27
by TestMeister
So in XY, navigate to the file, select it and hit the button, right?
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 19:04
by highend
Just double click it?
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 21:31
by TestMeister
Is there any way to have it appear in the mouse context menu the way the Open with works??
Re: Launch URL with Any Browser
Posted: 25 Mar 2022 22:23
by highend
|"Open url file" url>::load "Launch url with any browser.xys";