COMMENT
Reformat results for a completed Wordle game to include scores for partial and perfect guesses on each line. The shortcut can ouput results as reformatted emoji or as a single image saved to the Photos app.
TEXT
Shortcut Input

Text
VARIABLES
Set variable
Wordle Blurb
to
Text
COMMENT
If you want to use different emoji for Wordle results or different word meanings for each emoji, you can edit the action below.
DICTIONARY

Dictionary
VARIABLES
Set variable
Emoji Meanings
to
Dictionary
COMMENT
Match the first line of text in Wordle's default shared results
TEXT
Match
^Wordle\s(\d+)\s(\d)\/(\d)
in
Wordle Blurb

Matches
VARIABLES
Set variable
First Wordle Line
to
Matches
TEXT
Get
Group At Index
1
in
Matches

Text
VARIABLES
Set variable
Wordle Number
to
Text
TEXT
Get
Group At Index
2
in
Matches

Text
VARIABLES
Set variable
Attempts
to
Text
COMMENT
This is the line where the game was completed
TEXT
Get
Group At Index
3
in
Matches

Text
VARIABLES
Set variable
Turns
to
Text
TEXT
Match
(?s)^Wordle\s(\d+)\s(\d)\/(\d)(.+)
in
Wordle Blurb

Matches
TEXT
Get
Group At Index
4
in
Matches

Text
TEXT
Split
Text
by
New Lines

Split Text
SCRIPTING
Repeat with each item in
Split Text

Repeat Results
SCRIPTING
If
Repeat Item
has any value
VARIABLES
Add
Repeat Item
to
Emoji
SCRIPTING
Otherwise
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
TEXT
Combine
Emoji
with
New Lines

Combined Text
VARIABLES
Set variable
Emoji
to
Combined Text
TEXT
Split
Emoji
by
New Lines

Split Text
COMMENT
iterate on single lines
SCRIPTING
Repeat with each item in
Emoji as Individual Lines

Repeat Results
SCRIPTING
Get
All Keys
in
Emoji Meanings

Dictionary Value
COMMENT
Match each of the emoji for each line, and count the results for each emoji
SCRIPTING
Repeat with each item in
Emoji

Repeat Results
TEXT
Match
Repeat Item 2
in
Repeat Item

Matches
SCRIPTING
If
Matches
has any value
SCRIPTING
Count
Items
in
Matches

Count
SCRIPTING
Get
Value
for
Repeat Item 2
in
Emoji Meanings

Dictionary Value
TEXT
Dictionary Value
Count

Text
VARIABLES
Add
Text
to
Line Results
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
TEXT
Combine
Line Results
with
Custom
,

Combined Text
TEXT
Line
Repeat Index
-
Combined Text

Text
VARIABLES
Add
Text
to
Results without Emoji
TEXT
Repeat Item
(
Combined Text
)

Text
VARIABLES
Add
Text
to
Parsed Line Results
NOTHING
Nothing
VARIABLES
Set variable
Line Results
to
Input
SCRIPTING
End Repeat

Repeat Results
TEXT
Combine
Parsed Line Results
with
New Lines

Combined Text
COMMENT
The shortcut is hardcoded to replace '5 perfect' with 'Wordle done on Line X'. If you don't use the word 'perfect', you'll have to replace it manually in the action below for the text replacement to work.
DOCUMENTS
Replace
5 perfect
with
Wordle done on Line
Attempts
in
Combined Text

Updated Text
TEXT
First Wordle Line
Updated Text

Text
VARIABLES
Set variable
Final Results
to
Final Results
SCRIPTING
Choose from Menu

Menu Result
SCRIPTING
🟩 Copy as Emoji

Menu Result
SHARING
Copy
Final Results
to clipboard
SCRIPTING
Show alert
Wordle Results Copied
Title
Wordle Results Copied
SCRIPTING
🌄 Save as Image

Menu Result
TEXT
Split
Emoji
by
New Lines

Split Text
COMMENT
Repeat with each line, then repeat for each character
SCRIPTING
Repeat with each item in
Split Text

Repeat Results
TEXT
Split
Repeat Item
by
Every Character

Split Text
SCRIPTING
Repeat with each item in
Split Text

Repeat Results
COMMENT
Original technique by gluebyte: https://reddit.com/r/shortcuts/comments/muobc5/emoji_to_image_conversion/
URL
data:text/html;charset=utf-8,<body style="display:grid; place-content:center;padding-left:9;font-size:44; background-color:#ffffff;">
Repeat Item 2
</body>Â

URL
MEDIA

Cropped Image
SCRIPTING
End Repeat

Repeat Results
MEDIA
Combine
Repeat Results
Horizontally

Combined Image
VARIABLES
Add
Combined Image
to
Line as Image
SCRIPTING
End Repeat

Repeat Results
MEDIA
Combine
Line as Image
Vertically

Combined Image
PHOTOS
Save
Combined Image
to
Recents

Saved Photo Media
TEXT
Combine
Results without Emoji
with
New Lines

Combined Text
TEXT
First Wordle Line
Combined Text

Text
SHARING
Copy
Text
to clipboard
SCRIPTING
Show alert
Informational Message
SCRIPTING
End Menu

Menu Result