Fastest way to paste a URL from clipboard as a URL file?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
autocart
Posts: 1378
Joined: 26 Sep 2013 15:22

Fastest way to paste a URL from clipboard as a URL file?

Post by autocart »

Hi all,

What is the fastest way to paste a URL from clipboard as an URL file?

I want the same result as if I navigated to that URL in a browser and then dragged the URL from the browser's address bar (from its padlock icon) into XY.
But I don't want to have to open the URL in the browser first.
Is there a working solution for that in XY already available?

regards, me.

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Fastest way to paste a URL from clipboard as a URL file?

Post by highend »

The usual scripting?

Code: Select all

    $content = readurlutf8(<clp>);
    if ($content) {
        $head  = regexmatches($content, "<[ ]*?head[ ]*?>(\s|\S)*?<[ ]*?/head[ ]*?>");
        $title = regexmatches($head, "<[ ]*?title[ ]*?>.*?<[ ]*?/title[ ]*?>");
        $title = trim(regexreplace($title, "<[ ]*?/?title[ ]*?>"));
        if ($title == "") { $title = "Current URL"; }
        writefile($title . ".url", "[InternetShortcut]<crlf>URL=<clp>", , "utf8");
    }
One of my scripts helped you out? Please donate via Paypal

autocart
Posts: 1378
Joined: 26 Sep 2013 15:22

Re: Fastest way to paste a URL from clipboard as a URL file?

Post by autocart »

Ok, that i a helpful start, thank you very much!

Post Reply