Solution
In summary the relevant filepath is:
~/Library/KeyboardServices/TextReplacements.db
Extracting the data
to extract using sqlite3 (should be on macOS by default):
sqlite3 ~/Library/KeyboardServices/TextReplacements.db
Run the following commands to output the ZSHORTCUT and ZPHRASE to a CSV file:
.headers on
.mode csv
.output text_replacements.csv
SELECT ZSHORTCUT, ZPHRASE FROM ZTEXTREPLACEMENTENTRY;
.exit
Converting CSV to JSON
If you want to convert the CSV to JSON, you can either use a tool like jq or convert it with a Python one-liner (see attached text file).
python3 -c "
import csv, json
with open('text_replacements.csv') as f:
reader = csv.DictReader(f)
print(json.dumps(list(reader), indent=4))
" > text_replacements.json
Use the correct field names
in my case I opened in a text editor and replaced all "ZSHORTCUT" with "repalce" and all "ZPHRASE" with "with"
then imported the JSON file into the Firefox plugin called TextFast . all working now..
ChatGTP solved this for me
conversation_text.txt
LINK to ChatGTP instructions:
https://chatgpt.com/share/6708a59e-7ccc-8006-b095-d6da9545f587
in case that link doesn't work in future i attached as text file.
Topic:
Accessibility & Inclusion
SubTopic:
General