ZBrushCentral

Open a website from my plugin

How can I open a website in the browser from my ZScript plugin?

Hi,
Welcome to ZBC!

You can do it using the ZFileUtils dynamic library and the LaunchAppWithFile function, just specifying the URL as the file name. You can get ZFileUtils and read about it here:

http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/zfileutils/

Here’s briefly how you would use it:

[IButton,TestURL,"Open URL in default browser",
	[If, [ZBrushInfo,6], //if this is a Mac					
		[VarSet,dllPath,"MyPluginData/ZFileUtils.lib"]							
		, //else Windows				
		[VarSet,dllPath,"MyPluginData\ZFileUtils64.dll"]				
	]
	[VarSet,url,"http://pixologic.com/"] //the URL you want	
	[VarSet,err,[FileExecute,[Var,dllPath],"LaunchAppWithFile",#url]]
	[If,err,[Note,"An error occurred"]]
]
1 Like

Thank you Marcus!
This was helping a lot.

Helps a lot Thanks @marcus_civis!
Cheers! :grinning: :grinning: :grinning:

1 Like