Windows pop up - open file on server not url

I have a footer in a windows pop up.

I can set it to go to a URL but i’d like it to go to a link on our company server instead.

image

I’ve tried changing href to filePath or file but that doesn’t work.
Is is possible?
(Obviously I changed the http to the filepath.)

Most modern browsers will not allow this for security reasons as a URL, but try opening it directly with something like os.system() maybe?

How to Open Files with Python OS - wellsr.com.

2 Likes

you can use TaskDialogCommandLinkId

custombouttontasdialog

an example opening a directory

import clr
import sys
import System

clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
                               
my_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop)

myForum = 'https://forum.dynamobim.com/'

dialog = TaskDialog("Simple Dialog")
dialog.MainInstruction = 'Select Choice'
# Add Button
dialog.CommonButtons = TaskDialogCommonButtons.Cancel
# Add Command Link
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink1,
                      'Go To Desktop ?',
                      'open the Desktop directory')
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink2,
                      'Go to my favorite forum',
                      myForum)

result = dialog.Show()
if result == TaskDialogResult.CommandLink1:
	System.Diagnostics.Process.Start(my_path)
elif result == TaskDialogResult.CommandLink2:
	System.Diagnostics.Process.Start(myForum)
else:pass
5 Likes