Deducing parameters for .uno:whatever calls

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
mcasperson
Posts: 4
Joined: Wed Nov 28, 2012 4:51 am

Deducing parameters for .uno:whatever calls

Post by mcasperson »

I apologise if this has been asked already, but my googling did not turn out an answer.

I would like to know if there is some kind of process that can be used to find the parameters that can be passed to a .uno call, such as

Code: Select all

dispatcher.executeDispatch(document, ".uno:SaveGraphic", "", 0, Array())
. Quite often the macro recorder won't supply the options, if it records the disptach at all.

The Wiki page at http://wiki.openoffice.org/wiki/Framewo ... x_Commands does not list the parameters, and the macro which dumps the uno calls in the book from http://www.pitonyak.org/OOME_3_0.odt also does not provide the parameters.

I assume there is some way to look at the source code to deduce the parameters. If anyone could shed some light on this it would be much appreciated.
OpenOffice 3.6 with Centos 6.3
mauriciobaeza
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: Deducing parameters for .uno:whatever calls

Post by mauriciobaeza »

Hello ...

Do not recommend at all to spend time searching for the method parameters executeDispatch, you get much more if you learn to program macros using own objects, methods and properties ... here can answer your questions this.
______________________________________________
Everything not given is lost
AOO 4.1 / LibO 4.3 on ArchLinux with Gnome3
Please, I do not answer private questions, you use the forum
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Deducing parameters for .uno:whatever calls

Post by hanya »

If you really need to know them, search in *.sdi files of the source tree.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
mcasperson
Posts: 4
Joined: Wed Nov 28, 2012 4:51 am

Re: Deducing parameters for .uno:whatever calls

Post by mcasperson »

Like http://opengrok.libreoffice.org/xref/co ... x.sdi#5992? How do I read this file to get the parameters?
OpenOffice 3.6 with Centos 6.3
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Deducing parameters for .uno:whatever calls

Post by hanya »

Here is an example picked from the file.

Code: Select all

    275 SfxVoidItem Arc SID_DRAW_ARC
    276 (SfxUInt32Item CenterX ID_VAL_CENTER_X,SfxUInt32Item CenterY ID_VAL_CENTER_Y,SfxUInt32Item AxisX ID_VAL_AXIS_X, ...)
    277 [
           ...
    300 ]
The first line contains "Type name in command pool", "Name of the command" and "Numerical id of the command".
The second line lists arguments in round parentheses that the command allows to be specified. In this case, each arguments contains "Type name of the argument", "Name" and "Numerical id". So this section tells you what arguments can be passed. If this line is empty, the command does not take any arguments or it does not allow any arguments, maybe depends on some UI. If the type of some arguments is complicated type that can not be represented in your target language, it seems that it can not be passed.
Third sections lists some information and status information for commands placed in the menubar or toolbar.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
mcasperson
Posts: 4
Joined: Wed Nov 28, 2012 4:51 am

Re: Deducing parameters for .uno:whatever calls

Post by mcasperson »

Thanks for the info. It would seem that .uno:SaveGraphic doesn't have any parameters, which was throwing me (I assumed I could specify the details like file name).
OpenOffice 3.6 with Centos 6.3
Ron H.
Posts: 7
Joined: Thu Sep 03, 2015 11:20 pm

Re: Deducing parameters for .uno:whatever calls

Post by Ron H. »

This question may have a few parts.

First let me identify that I am new to the OO forum. (I don't know if there is any advantage with regard to using macros between LibreOffice as opposed to Open Office, but I welcome any opinions)

My specific question is similar to one given by member mcasperson on Apr 15, 2013, "Deducing parameters for .uno:whatever calls.

This question pertains to using macros with Writer. I'm running off Windows for now, and I'm pretty acquainted with Microsoft's VBA but not at all yet with OO basic. But I think I could pick it up quickly.

Specifically I'm trying to create a Text Frame from a macro and set some property values. I used "Record Macro" to get started, but the recording only sets 5 property values, and not some of the other properties that I need. So how do I find reference to property names to set the other property values? Specifically, how do I refer to the properties that correspond with the [Insert] Frame dialog box for the properties at the bottom, labeled "Position":

Horizontal position: __________
by __________
from __________

___ Mirror on Even Pages

Vertical position: __________
by __________
from __________


(1.) By the UNO dispatch method, (as created using "Record Macro"), the code is essentially. . .

dim args1(4) as new com.sun.star.beans.PropertyValue
args1(0).Name = "AnchorType", . . . etc., Pos.X, Pos.Y, Size.Width, Size.Height

But how do I find the UNO reference for the OTHER properties I need.

(2.) Or, better yet, as member mauriciobaez responded in the same thread, ". . . you get much more if you learn to program macros using own objects, methods and properties. . . "

Could someone be so kind as to give me a little snippet example of how to do what I'm asking without UNO dispatches? (Insert a Text Frame and set the needed properties.)

(3.) And finally, member hanya added to the thread, "If you really need to know them, search in *.sdi files of the source tree."

Hate to be ignorant, but where are these *.sdi files you refer to and what do you mean by source tree. I searched the folders installed with both LibreOffice and Open Office and came up empty-handed.

All these questions expose of course, that I'm a total beginner. So I look to help from any of you who better understand the ropes!

Thanks,
Ron H.
Ron H. (LibreOffice 4.3.6.2)
j.kornelsn
Posts: 14
Joined: Wed Oct 06, 2010 6:26 am

Re: Deducing parameters for .uno:whatever calls

Post by j.kornelsn »

Ron H, an example of creating a text frame is at:
https://www.openoffice.org/api/docs/com ... Frame.html
LO / AOO on Ubuntu / Windows
Post Reply