Run Applescript on Selection/Story/Document
Hi all
Is it possible to tell an Applescript to run on the selected text only? If so, please tell me how!
My script (condensed version):
tell application "Adobe InDesign CC 2018"
my GrepSearch("(January|February|March|April|May|June|July|August|September|October|November|December) (\\d{1}|\\d{2}), (\\d{4})")
my GrepSearch("(January|February|March|April|May|June|July|August|September|October|November|December) (\\d{4})")
end tell
on GrepSearch(f)
tell application "Adobe InDesign CC 2018"
set find grep preferences to nothing
set change grep preferences to nothing
set find what of find grep preferences to f
set no break of change grep preferences to true
change grep
end tell
end GrepSearch
(searching for date strings and telling ID to apply No Break character attribute to the strings)
Thank you in advance!
