Alert box(Dialog) that can be copied using JavaScript

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
dammyg
Posts: 4
Joined: Sun Aug 20, 2017 5:31 am

Alert box(Dialog) that can be copied using JavaScript

Post by dammyg »

I am having trouble finding information on how to create a popup box that can be copied using JavaScript similar to window.alert in JavaScript.
Any help would be much appreciated.

This is what I tried but dialog becomes null so I assume there is a problem in how I am using the queryInterface function:

importClass(Packages.com.sun.star.ui.dialogs.XExecutableDialog);
function alert(str){
var oModel = XSCRIPTCONTEXT.getDocument();
var dialog = UnoRuntime.queryInterface(XExecutableDialog, XExecutableDialog);

dialog.setTitle(str);
dialog.execute();
}
OpenOffice 4 on Windows 8 / Openoffice 4 on Windows 10
Post Reply