Page 1 of 1

Website URL Shortcut

Published: November 21, 2018 - 4:50 PM
by gaelds
Hello,

I would like to add a URL to a website on the public desktop of some computers, but it doesn't seem to work with create_shortcut?

Re: Website URL Shortcut

Published: November 22, 2018 - 12:33 PM
by Floflobel
Hello,

could you please post your package code so we can help you?

Re: Website URL Shortcut

Published: November 23, 2018 - 8:04 AM
by gaelds
I just found the solution through trial and error:

Code: Select all

def install():
    print("Copie de l'icone dans c:windows")
    filecopyto(ur"wapt.ico",makepath("C:","Windows"))
    print('Ajout du raccourci Forum wapt)
    create_desktop_shortcut(
         makepath(common_desktop(),ur"Forum wapt.lnk"),
         target=makepath(programfiles,'Mozilla Firefox','firefox.exe'),
         arguments='"%s"' % makepath("https://forum.tranquil.it/"),
        icon=makepath('C:','Windows','wapt.ico'))
This implies that Firefox is installed on the PC, but normally all my machines have the Firefox package... If there is another solution to specify a URL as the target or something else, I'm interested.

Re: Website URL Shortcut

Published: November 23, 2018 - 09:10
by sfonteneau
In the create_desktop_shortcut documentation:

https://github.com/tranquilit/WAPT/blob ... rs.py#L438

TIP: a simple shortcut in PyScripter that you learn in training:

when you are completing a function, you can press Ctrl + Shift + Space. This will display the function's help and assist you.

You can also Ctrl + Click on the function to directly view it in the setuphelpers file (be careful not to modify this file).

Re: Website URL Shortcut

Published: November 23, 2018 - 12:36 PM
by gaelds
Thanks Simon!

So, it turns out I just wanted to create a .LNK file when you need to specify .URL for website URLs.

`create_shortcut(makepath(common_desktop(),ur"wapt.URL"),target=r'https://forum.tranquil.it/', icon=makepath('C:','Windows','wapt.ico'))`