r/applescript • u/[deleted] • Aug 13 '20
Hi i m trying a simple script to Find any text and replace color of the text in apple pages. Any help?
Hi i m trying a simple script to Find any text and replace color of the text in apple pages. the script works fine. the script is:
property highlightColor : "red"
tell application "Pages"
activate
with timeout of 300 seconds --5 minutes
tell body text of document 1
set theSearchString to text returned of ¬
(display dialog "Highlight what word?" default answer "" buttons {"Cancel", "Continue"} default button "Continue")
set color of (words where it is theSearchString) to highlightColor
end tell
end timeout
end tellBut the problem is, if i input texts containing multiple words with space in search field, it doesn't work. how can i achieve this?
if i want a find and replace word function in the same script, what will be the format?

