I Would Like to Learn a Macro Language LO 5.0

classic Classic list List threaded Threaded
9 messages Options
mowestusa mowestusa
Reply | Threaded
Open this post in threaded view
|

I Would Like to Learn a Macro Language LO 5.0

I'm running LibreOffice 5.0 on Windows 10.
I really enjoy LibreOffice, and I would like to write some simple macros to get even more value out of LibreOffice. Writing macros will be my first programming experience, but would provide the most benefit for my profession since I mostly produce documents, spreadsheets, and presentations in my vocation since I do a lot of teaching. I found some materials to assist with learning and getting started with LibreOffice Basic:  
   - https://wiki.documentfoundation.org/Macros 
   - https://help.libreoffice.org/Common/Scripting 

However, while looking through the LibreOffice 5.0 Help documentation, I found this under LibreOffice Basic / Basic / programming page:
Programming LibreOfficeLibreOfficecan be controlled by using the LibreOffice API.
|     |  LibreOffice provides an Application Programming Interface (API) that enables you to control LibreOffice components by using various programming languages. A LibreOffice Software Development Kit is available for the programming interface.  |

 

|     |  For more information about LibreOffice API reference, please visit http://api.libreoffice.org/  |



|     |  Macros created with LibreOffice Basic based on the old programming interface will no longer be supported by the current version. |


Formore information on LibreOffice Basic, select "LibreOffice Basic" inthe list box.
So before I start investing a lot of time in learning LibreOffice Basic, would I be better served learning to script macros in a different language that would then access the LibreOffice API?If so, which language works best using LibreOffice 5.0 on Windows 10 to write macros?
Possible Macros that I would like to create:- A macro that automates the formatting of a paragraph, changing the style, superscripting numbers, etc...- A macro that provides a quick way to look for Creative Commons graphics by opening a browser search page. (It would be similar to the "Research" panel in Google Docs)- A macro that provides a quick way to look up a meaning of a highlighted word in an online dictionary.
 ---------------------------- | Steve | | [hidden email] | ----------------------------
--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Andrew Douglas Pitonyak Andrew Douglas Pitonyak
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0



On 10/04/2015 01:25 AM, mowestusa wrote:

> I'm running LibreOffice 5.0 on Windows 10.
> I really enjoy LibreOffice, and I would like to write some simple macros to get even more value out of LibreOffice. Writing macros will be my first programming experience, but would provide the most benefit for my profession since I mostly produce documents, spreadsheets, and presentations in my vocation since I do a lot of teaching. I found some materials to assist with learning and getting started with LibreOffice Basic:
>     - https://wiki.documentfoundation.org/Macros
>     - https://help.libreoffice.org/Common/Scripting
>
> However, while looking through the LibreOffice 5.0 Help documentation, I found this under LibreOffice Basic / Basic / programming page:
> Programming LibreOfficeLibreOfficecan be controlled by using the LibreOffice API.
> |     |  LibreOffice provides an Application Programming Interface (API) that enables you to control LibreOffice components by using various programming languages. A LibreOffice Software Development Kit is available for the programming interface.  |
>
>  
>
> |     |  For more information about LibreOffice API reference, please visit http://api.libreoffice.org/  |
>
>
>
> |     |  Macros created with LibreOffice Basic based on the old programming interface will no longer be supported by the current version. |
>
>
> Formore information on LibreOffice Basic, select "LibreOffice Basic" inthe list box.
> So before I start investing a lot of time in learning LibreOffice Basic, would I be better served learning to script macros in a different language that would then access the LibreOffice API?If so, which language works best using LibreOffice 5.0 on Windows 10 to write macros?
> Possible Macros that I would like to create:- A macro that automates the formatting of a paragraph, changing the style, superscripting numbers, etc...- A macro that provides a quick way to look for Creative Commons graphics by opening a browser search page. (It would be similar to the "Research" panel in Google Docs)- A macro that provides a quick way to look up a meaning of a highlighted word in an online dictionary.
>

I do not have time to review all of this, but...

Ultimately, all supported languages use the same internal API, it is
mostly a question of which language you prefer to use. External
languages are generally more difficult to use initially because there
are usually external things that you must link to. The do provide more
flexibility than the built-in Basic because of their external libraries,
better IDEs, and similar. On the other hand, Basic provides many things
for free. For example, when you have an object (say a document, or a
graph), that object typically will support services and interfaces. I
won't trouble you with the details on this, but,

Suppose that an object supports an "index container" interface that lets
me access the contained things based on a numerical interface. Before I
can use that interface in Java or C++ (which I don't generally use to
control LO), I must access that interface. There are two difficulties
with this. First, I need to know which interface I need to get and
second, I need to go to the trouble of getting it. This might not be
overly difficult, but, with BASIC, that is generally hidden from you so
you can directly use all of the interfaces on the object. It just makes
it a bit easier. Sorry, I did not take the time to make this more clear,
but, I have a class I need to go teach now.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0

In reply to this post by mowestusa
On 10/04/2015 07:25 AM, mowestusa wrote:
> |     |  Macros created with LibreOffice Basic based on the old programming interface will no longer be supported by the current version. |

Do you have a link to where you found the above quote?  At least taken
out of context, it looks very wrong.  (So I would assume "old
programming interface" and "current version" actually refer to ancient
history, fully irrelevant now.)

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Nino Nino
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0



Am 05.10.2015 um 09:44 schrieb Stephan Bergmann:
> On 10/04/2015 07:25 AM, mowestusa wrote:
>> |     |  Macros created with LibreOffice Basic based on the old
>> programming interface will no longer be supported by the current version. |
>
> Do you have a link to where you found the above quote?

e.g. here: https://help.libreoffice.org/Common/Programming

Nino



--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0

Hi,

Nino Novak schrieb:

>
>
> Am 05.10.2015 um 09:44 schrieb Stephan Bergmann:
>> On 10/04/2015 07:25 AM, mowestusa wrote:
>>> |     |  Macros created with LibreOffice Basic based on the old
>>> programming interface will no longer be supported by the current version. |
>>
>> Do you have a link to where you found the above quote?
>
> e.g. here: https://help.libreoffice.org/Common/Programming
>

That is helpcontent2/source/text/shared/main0600.xhp
Best would be to remove it. But I don't have looked which bookmarks and
index entries have to be changed then. At least the section
'id="basicalt"' has to be removed totally. The current one is in
helpcontent2/source/text/sbasic/shared/main0601.xhp.

Please write a bug report.

Kind regards
Regina




--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0

On 10/05/2015 11:10 AM, Regina Henschel wrote:

> Nino Novak schrieb:
>> Am 05.10.2015 um 09:44 schrieb Stephan Bergmann:
>>> On 10/04/2015 07:25 AM, mowestusa wrote:
>>>> |     |  Macros created with LibreOffice Basic based on the old
>>>> programming interface will no longer be supported by the current
>>>> version. |
>>>
>>> Do you have a link to where you found the above quote?
>>
>> e.g. here: https://help.libreoffice.org/Common/Programming
>>
>
> That is helpcontent2/source/text/shared/main0600.xhp

And that line is in there ever since
<http://cgit.freedesktop.org/libreoffice/help/commit/?id=4f48bcc7937fbc586af7720d4225768ee6913e2a>
"#i33146# Initial checkin," which confirms my assumption that it is a
dead, historic remark.

> Best would be to remove it. But I don't have looked which bookmarks and
> index entries have to be changed then. At least the section
> 'id="basicalt"' has to be removed totally. The current one is in
> helpcontent2/source/text/sbasic/shared/main0601.xhp.
>
> Please write a bug report.

So I'll leave it to others who are knowledgeable about helpcontent2 to
get this fixed.

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Andreas Säger Andreas Säger
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0

In reply to this post by mowestusa
Am 04.10.2015 um 07:25 schrieb mowestusa:

Writing macros will be my first programming experience,

This is a huge problem. Starting with UNO and StarBasic is the worst
entry point I can think of. You will have a very hard learning
exprerience because UNO is far too big and too complex for a beginner.
No matter how far you get with UNO and StarBasic, you will not end up as
a programmer.
UNO makes professional programmers cry and StarBasic does not make
anything easier because this language is out of date, buggy, poorly
documented, does not fit into its UNO surrounding, offers a very poor
set of functionality (compared to JavaScript and Pyhon) and it is
totally useless outside its UNO cage. The old literature on Visual Basic
does not apply very well and the existing literature presumes that you
are a (VBA-)programmer already.
This is like learning how to fly in a 747 cockpit (UNO) sitting on a
garden chair (StarBasic) as pilot seat.
Learning object oriented programming with Java, JavaScript or Python is
easy nowadays. Coming back to UNO with certain concepts and tools will
take you much further with less effort.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0

At 19:19 05/10/2015 +0200, Andreas Säger wrote:
>This is like learning how to fly in a 747
>cockpit (UNO) sitting on a garden chair (StarBasic) as pilot seat.

I dare say most airline pilots, with early
childhood imagination, started in exactly this
way. One can imagine the arm actions and the sound effects!

Brian Barker  


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

mowestusa mowestusa
Reply | Threaded
Open this post in threaded view
|

Re: I Would Like to Learn a Macro Language LO 5.0

In reply to this post by Andreas Säger
Andreas,
Thank you for your reply. You made some excellent points that make sense. JavaScript is one of the options that I was considering because I would then be able to use my knowledge for other programs that have adopted JavaScript as their macro language of choice (like Google Docs). At the same time, I have no desire to jump from macro writing to full programming. I love my profession, but I would like to enhance my day to day usage of LibreOffice to save clicks of the mouse and pecks on the keyboard. A few basic macros would allow me to add functionality that may not be practical features for the LibreOffice programmers to code for releases. I thought it might be best to just use StarBasic by studying the materials that Andrew Pitonyak has provided and other sources that I highlighted in my first message thinking it might be the fastest way to accomplish the tasks I wanted to do.

I would be interested in hearing your thoughts on learning JavaScript (also what resources you recommend) and using that as my macro language of choice with LibreOffice.



From: Andreas Säger
Sent: Monday, October 5, 2015 1:19 PM
To: [hidden email]
Subject: [libreoffice-users] Re: I Would Like to Learn a Macro Language LO 5.0


Am 04.10.2015 um 07:25 schrieb mowestusa:

Writing macros will be my first programming experience,

This is a huge problem. Starting with UNO and StarBasic is the worst
entry point I can think of. You will have a very hard learning
exprerience because UNO is far too big and too complex for a beginner.
No matter how far you get with UNO and StarBasic, you will not end up as
a programmer.
UNO makes professional programmers cry and StarBasic does not make
anything easier because this language is out of date, buggy, poorly
documented, does not fit into its UNO surrounding, offers a very poor
set of functionality (compared to JavaScript and Pyhon) and it is
totally useless outside its UNO cage. The old literature on Visual Basic
does not apply very well and the existing literature presumes that you
are a (VBA-)programmer already.
This is like learning how to fly in a 747 cockpit (UNO) sitting on a
garden chair (StarBasic) as pilot seat.
Learning object oriented programming with Java, JavaScript or Python is
easy nowadays. Coming back to UNO with certain concepts and tools will
take you much further with less effort.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted