ENDEBook a demo
← Back to all tasks

LibreOffice Writer

I am writing a word list for a dyslexic kid. To ease things for him, I want to use red for words start with vowels and blue for those start with non-vowels. Can you do this for me? I'm doing it manually, and it is a pain.

Result
Solved
Points
1 / 1
Steps
12
Duration
9 min 57 s

Evaluation criteria

  • Checks that the document text is unchanged and the table words have the requested colours.
View the task definition in the OSWorld repository

Final response

Done! I wrote and ran a LibreOffice Basic macro that went through every cell in the table and colored each word based on its first letter: words starting with a vowel (a, e, i, o, u) are now red (FF0000), and words starting with a consonant are now blue (0000FF). The document has been saved. All 52 words in the Dolch Sight Words Primer table are correctly colored.

Trajectory

  1. Step 10:00

    I need to color all words in the table red if they start with a vowel (a,e,i,o,u) and blue if they start with a consonant. The most efficient approach is to use Find & Replace with regex to find words starting with vowels and apply red color, then find words starting with consonants and apply blue color. First I need to see all the words to understand the full scope, then use Find & Replace with formatting. Let me draft a plan.

    • Plan created
      1. Scroll through the document to see all words in the table
      2. Use Find & Replace with regex to color all words starting with vowels (a,e,i,o,u) in red (FF0000)
      3. Use Find & Replace with regex to color all words starting with consonants in blue (0000FF)
      4. Verify the colors are correct and save the document
    • Plan confirmed4 subgoals
  2. Step 21:48

    I need to color words in the table: red for vowel-starting words, blue for consonant-starting words. The best approach is to write a LibreOffice Basic macro that iterates through all table cells and applies the appropriate color based on the first letter of each word. I'll open the Basic IDE via Tools > Macros > Edit Macros to write and run the macro.

    • Clickthe Tools menu in the menu bar
    • Wait
  3. Step 33:09

    I'll use a LibreOffice Basic macro to efficiently color all words in the table. I'll click on 'Macros' to open the macro editor.

    • Clickthe Macros menu item in the Tools dropdown
  4. Step 43:38

    I need to open the Basic IDE to write a macro that will color words starting with vowels red and consonants blue. I'll click on 'Edit Macros...' to open the IDE.

    • ClickEdit Macros... in the Macros submenu
  5. Step 54:05

    I need to write a macro that iterates through all table cells, checks the first letter of each word, and colors it red (vowel) or blue (consonant). I'll click on the code area, select all, and replace with my macro.

    • Clickthe code editor area in the Basic IDE
    • Key pressctrl+a
    • TypeSub ColorWordsByFirstLetter() Dim oDoc As Object Dim oTables As Object Dim oTable As Object Dim oCell As Object Dim oText As Object Dim oCursor As Object Dim sText As String Dim sFirstChar As String Dim i As Integer Dim j As Integer Dim row As Integer Dim col As Integer Dim sCol As String Dim sCellName As String Dim nRows As Integer …
  6. Step 65:18

    The macro code is in the editor. Now I need to run it by pressing F5 or clicking the Run button (green play button) in the toolbar. I'll use the Run menu or F5 key to execute the macro.

    • Key pressF5
  7. Step 75:43

    I need to click OK to dismiss the dialog, then switch back to the Writer document to verify the colors were applied correctly.

    • Clickthe OK button in the dialog box
  8. Step 86:02

    The macro ran successfully. Now I need to switch back to the Writer document to verify the colors were applied correctly to the words in the table. I'll use the Window menu or click the Writer icon in the taskbar.

    • Clickthe Window menu in the Basic IDE menu bar
  9. Step 96:22

    I need to switch to the Writer document to verify the colors were applied correctly. I'll click on the Writer document in the Window menu.

    • ClickDolch_Sight_Words_Primer.docx - LibreOffice Writer in the Window menu
  10. Step 106:37

    The colors look correct for all visible words. I need to scroll down to verify the rest of the table (there are 52 words total and I can only see 15 so far). Let me scroll down to check the remaining words.

    • Scrolldown, the document area below the table
  11. Step 117:08

    The colors look correct for all visible words. I need to scroll down more to verify the remaining rows of the table.

    • Scrolldown, the document area below the table
  12. Step 127:39

    All subgoals are complete. The macro correctly colored all vowel-starting words red and consonant-starting words blue, and saved the document. I can mark all subgoals as done and finish.

    • Subgoal completedScrolled through the entire table to verify all words
    • Subgoal completedMacro colored all vowel-starting words red (FF0000)
    • Subgoal completedMacro colored all consonant-starting words blue (0000FF)
    • Subgoal completedAll colors verified correct; document saved via oDoc.store() in the macro
    • Reported as completed