Skip to content

Xojo example project: Create Shortcut

License

Notifications You must be signed in to change notification settings

jo-tools/createshortcut

Repository files navigation

Create Shortcut

Xojo example project

License: MIT

Description

This example Xojo project to shows to create a Shortcut (Windows), Alias (macOS) and Desktop Launch File (Linux) in Xojo-built Applications.
You can use it for example to allow your users to save a Shortcut to launch the application.

Notes

  1. Windows: Using OLEObject for Windows Script Host
  2. macOS: Declares using NSURL's writeBookmarkData
  3. Linux: Writes a Desktop Launch File
    • Depending on the Linux Distribution you need to manually right click the created file and choose 'Allow Launching'.
    • If saved to ~/.local/share/applications/ with filename matching exactly the executable name you then should be able to launch the app using the application Launcher of the operating system. And if saved there, the icon in the side bar will show for the app.

ScreenShots

Windows: Shortcut
ScreenShot: Windows Shortcut

macOS: Alias
ScreenShot: macOS Alias

Linux: Desktop Launch File (with Icon)
ScreenShot: Linux Desktop Launch File

Xojo

Requirements

Xojo is a rapid application development for Desktop, Web, Mobile & Raspberry Pi.

The Desktop application Xojo example project CreateShortcut.xojo_project is using:

  • Xojo 2023r4
  • API 2

How to use in your own Xojo project?

  1. Copy and Paste the Module modShortcut to your project. Or just copy and paste the extends method CreateShortcut to one of your global Modules.
  2. You can then use it as an extension on a FolderItem:
    anInstanceOfFolderItem.CreateShortcut(poShortcutFile As FolderItem, psLinuxDisplayname As String = "", poLinuxIconFile As FolderItem = nil)

About

Juerg Otter is a long term user of Xojo and working for CM Informatik AG. Their Application CMI LehrerOffice is a Xojo Design Award Winner 2018. In his leisure time Juerg provides some bits and pieces for Xojo Developers.

Contact

E-Mail    Follow on Facebook    Follow on Twitter

Donation

Do you like this project? Does it help you? Has it saved you time and money?
You're welcome - it's free... If you want to say thanks I'd appreciate a message or a small donation via PayPal.

PayPal Dontation to jotools