Create Shortcut to Internet Web Page

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Create Shortcut to Internet Web Page

Post by hrcap » Sun Aug 30, 2020 5:29 pm

Hi All

I hope that everyone is having a good weekend.

Is there a way to create a shortcut to an internet webpage on the users desktop, I know how to create a file alias on the desktop using the 'create alias' command but I can't get that to work for a webpage shortcut.


Many Thanks

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Create Shortcut to Internet Web Page

Post by richmond62 » Sun Aug 30, 2020 5:32 pm

Do you want to do that using LiveCode?

Shortcuts are implemented in different ways in different operating systems, and in the Linux world
in different ways in different windowing environments and so on.

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Shortcut to Internet Web Page

Post by hrcap » Sun Aug 30, 2020 5:35 pm

Hi Richmond

Ideally yes, I have a database which stores links to documents in dropbox, I would like to be able to create shortcuts to these web links, much the same as how the create alias command works, only opening a web page and not a file.


Many Thanks

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create Shortcut to Internet Web Page

Post by Klaus » Sun Aug 30, 2020 5:43 pm

Hi hrcap,

Mac:
This is how a .webloc file looks like.
It is plain XML on the Mac, I just dragged the LC forum url from Safari to my desktop:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>URL</key>
	<string>https://forums.livecode.com/index.php</string>
</dict>
</plist>
No idea about windows, sorry.

Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Create Shortcut to Internet Web Page

Post by richmond62 » Sun Aug 30, 2020 6:33 pm

No idea about windows, sorry.
And Linux with GNOME, XFCE, LXDE and so on?

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Shortcut to Internet Web Page

Post by hrcap » Sun Aug 30, 2020 6:39 pm

Lovely Thanks Klaus

I am trying to upload an example stack that I have just created but it is telling me that .livecode is an invalid file extension to upload to the forum?


Many Thanks

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create Shortcut to Internet Web Page

Post by Klaus » Sun Aug 30, 2020 6:46 pm

ZIP the stack and then upload!

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create Shortcut to Internet Web Page

Post by Klaus » Sun Aug 30, 2020 6:48 pm

richmond62 wrote:
Sun Aug 30, 2020 6:33 pm
No idea about windows, sorry.
And Linux with GNOME, XFCE, LXDE and so on?
And also no idea about Linux with GNOME, XFCE, LXDE and so on.

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Shortcut to Internet Web Page

Post by hrcap » Sun Aug 30, 2020 6:50 pm

Thank Klaus (we'll get there in the end)

Please find attached stack which creates Mac web shortcuts.

I assume it would work very much the same for Windows but would just need to have the XML and .extension that is relevant to the Windows OS.



Many Thanks
Attachments
Shortcut to Web Page.livecode.zip
(1.64 KiB) Downloaded 214 times

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Create Shortcut to Internet Web Page

Post by ghettocottage » Sun Aug 30, 2020 7:26 pm

Why not just create an html page with a redirect to your link ( link.html ) with the content something like:

Code: Select all

<html>
<head>
<title>redirects to link after 1 second</title>
<meta http-equiv="refresh" content="1; URL=http://livecode.digio.space/">
<meta name="keywords" content="automatic redirection">
</head>
<body>

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Shortcut to Internet Web Page

Post by hrcap » Sun Aug 30, 2020 7:49 pm

Thanks for the HTML suggestion

I have attached updated version of the example to include this.

I assume the HTML shortcut will work regardless of Windows of Mac?



Many Thanks
Attachments
Shortcut to Web Page.livecode.zip
(1.76 KiB) Downloaded 223 times

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Create Shortcut to Internet Web Page

Post by ghettocottage » Sun Aug 30, 2020 8:33 pm

I am running linux ( Ubuntu 20.04). It works for me. It asks where I want to save it and for a file-name and then it creates the html file.

My linux machine defaults to opening HTML documents with the default browser, so firefox opens when I click on the saved html file.
If I remember correctly, Windows does the same thing.

Some developers might have HTML documents set to open with a text editor, but they would still see the link and know what it means.

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Shortcut to Internet Web Page

Post by hrcap » Sun Aug 30, 2020 8:48 pm

That’s excellent, thank you very much for the feedback and help

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Create Shortcut to Internet Web Page

Post by richmond62 » Sun Aug 30, 2020 8:50 pm

That works perfectly well on Xubuntu 20.04. 8)

Post Reply