2

I use the below IronPython script to open a Windows Explorer to a define path which works perfectly within the client Spotfire.

When I run the same script within the Spotfire Webplayer, the Windows explorer don’t open.

No error message is displayed, but I see the below info in the bottom toolbar : Javascript:void(0);

# This script executes an external program. 

#Script Parameters
program = 'explorer.exe'
url = 'file://U:/Data/Downloads/'

#A. We need the Process class to execute external programs
from System.Diagnostics import Process

#B. Create new process instance
p = Process()

#B.1 Configure your process
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.FileName = program
p.StartInfo.Arguments = url

#C. Start the process and wait 
p.Start()
p.WaitForExit()

How can I update my script to make it work also into the Spotfire Webplayer.

1 Answers1

1

On Spotfire webplayer, the script is run on the server. When you create a process to execute a program, it is created on the server. That's why you can't open programs (like explorer) on the client.

You can't do this on the client, the best way to do this is probably to have a TextArea in which you put the link of the folder. That way, when a user click on the link it opens the explorer.

txemsukr
  • 1,017
  • 1
  • 10
  • 32