Bug 159402 - Writer should offer a working macro immediately user-available, to encourage new macro users
Summary: Writer should offer a working macro immediately user-available, to encourage ...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyBeginner, skillLibreOfficeBASIC
Depends on:
Blocks:
 
Reported: 2024-01-27 18:29 UTC by carrt7
Modified: 2024-02-06 12:14 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description carrt7 2024-01-27 18:29:51 UTC
Description:
Writer has a great macro utility, with an extensive helpful introduction for noobs  (https://books.libreoffice.org/en/GS70/GS7013-GettingStartedWithMacros.html)

BUT - very few users ever learn to write macros, partly because there is no working example they can easily run.

We need a simple macro available on the task-bar, which can be run simply by clicking the icon, and does no damage.

For example, it could save to Desktop a copy of the currently selected text being edited.  Or change the font.

The user is then prompted to consult Tools / Macros / etc to find out more, and can modify it.

Steps to Reproduce:
1.Edit any document in Writer, select a paragraph
2.
3.

Actual Results:
No simple way to run an existing safe macro on the document or selection.  Online documentation is extensive but arduous, involving multiple non-intuitive steps before anything can be run.

Expected Results:
Most users will never explore the macro utility - perhaps this is why the support documentation has not been updated for years.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Most complex tasks are best approached by modifying something that works, and learning by trial and error.  Detailed instructions are easier to follow at a later stage.

example:  A regex tutorial will usually start with some simple command that can be executed within a few keystrokes.
Comment 1 Stéphane Guillou (stragu) 2024-01-29 01:42:55 UTC
Heiko, Rafael, Olivier, Jean-François, what do you think?

I like the idea of a simple, sample macro that's easy to find, with enough comments so it is self-explanatory, to see what scripting makes possible.

Curious beginners going to Tools > Macros > Edit Macros won't know where to start with the IDE that's presented to them and the default empty macro. If they open the "Application Macros & Dialogs" collection, they won't easily find a sample module directed at beginners.

Could there be, for each component, a "Macro demo - start here" module?

(In reply to carrt7 from comment #0)
> We need a simple macro available on the task-bar, which can be run simply by
> clicking the icon, and does no damage.
I wouldn't clutter the UI with that. I'd prefer e.g. a direct link from a Tip of the Day.
Comment 2 Heiko Tietze 2024-01-29 08:44:50 UTC
We have plenty of examples, see Tools > Macros > Edit Macros: Application Macros & Dialogs, eg. Gimmicks > AutoText... run per F5.

I don't think that we should make it easier to run/edit since using macros is rather an expert feature and bear some security issue. => WF
Comment 3 Heiko Tietze 2024-01-29 08:47:53 UTC Comment hidden (off-topic)
Comment 4 Rafael Lima 2024-01-30 12:10:36 UTC
I understand there is a steep learning curve for writing LibreOffice scripts (either Basic or Python), and we should consider strategies to make it easier to learn the basics of macro programming in LO.

I'm not sure the proposed solution by the OP is the way to go, but let's take this opportunity to discuss the issue. It took me a very long time to get my head around all the things needed to write LO macros, so I can imagine many people struggle to get started.

I believe we should have a Tutorials library with simple and useful scripts for all LO apps (Writer, Calc, Impress and Draw), which could serve as templates for those getting started with LO macros.

In fact, bug 123540 points out that we already have a Tutorials library (in instdir/share/basic/Tutorials), but it is hidden from users because over time some of these macros stopped working.

Maybe we could consider reviving this library, fixing its issues and adding new macros with lots of comments for new LO macro programmers.
Comment 5 Heiko Tietze 2024-01-30 14:18:13 UTC
Those tutorials belong to the user space, ie. the wiki. And IIRC we have a group of people supporting the macro development... https://blog.documentfoundation.org/blog/2021/04/28/libreoffice-macro-team-progress-report-3/
Comment 6 Jean-Pierre Ledure 2024-02-06 12:14:30 UTC
(In reply to Rafael Lima from comment #4)

> Maybe we could consider reviving this library, fixing its issues and adding
> new macros with lots of comments for new LO macro programmers.

After a brief analysis, it seems that:
- the code of the Tutorials library is present
- the library itself is not visible because Tutorials is not mentioned in the dialog.xlc and script.xlc files
- the library requires one or more files in /instdir/share/template/common/tutorials/. This directory is absent.
- initialization code like
    createUNOService("com.sun.star.wizards.tutorial.executer.CallTutorialFramework")
returns a Null object
- the text present by default in the myText control of the TutorialsDialog dialog makes me think that the functionality was designed to guide new LO users, not new LO Basic users. (*) see below.

** My conclusion is that the functionality was once dropped but incompletely.**

(*)
This text explains all the action items that the user can do to follow the current step highlighted in the road map at the left side of the tutorial window.

1. Open the Format menu
2. Choose the Paragraph command
3. Click the Numbering tab

The first step will always explain what the current tutorial is about.

The last step - it is highlighted currently in the road map - will summarize what the user now has seen or learned.