Home › Forums › General XMetaL Discussion › Create toolbar button or macro to go to URL › Reply To: Create toolbar button or macro to go to URL
Reply to: Create toolbar button or macro to go to URL
May 18, 2012 at 7:50 pmThere's an API for that:
//JScript:
Application.ShowPage("strURL");
Where strURL is the page you wish to display.
If the user has never specified the path to a browser (they would need to have selected File > Preview in Browser) then they will be prompted to provide that path when this API is first called. That value is saved in their per-user copy of xmetal##.ini (in your case xmetal46.ini).
Using the Windows Script Host “Run” API:
The alternative would be to “run” the URL and allow Windows to decide which application to launch based on the user's file associations or the format of the URL. It may or may not launch a browser though it should for most people. Example:
//JScript:
var oWSH = new ActiveXObject("WScript.Shell");
oWSH.Run("http://www.xmetal.com");
oWSH = null;