Process Indesign Grep Search

Hi

I’m using the following script, to search for fixture times within an InDesign Document.


Unformatted InDesign text would be.

Monday 19 March
Gates 1.23 am First 4:56pm Last RACE 7.12pm

tell application "Adobe InDesign CS3"
	
	--Clear the Find/Change fields
	set find text preferences to nothing
	set change text preferences to nothing
	
	--Set FindWhat/ChangeTo values
	set find what of find grep preferences to "(\\n|\\r)[Gg][\\u\\l ]+(\\d+)[.:](\\d+)[\\u\\l ]+(\\d+)[.:](\\d+)[\\u\\l ]+(\\d+)[.:](\\d+)[\\l\\u]+"
	set change to of change grep preferences to "$1Gates Open $2.$3amƒFirst Race $4.$5pmƒLast Race $6.$7pm"
	
	--set the find options
	set include footnotes of find change grep options to false
	set include hidden layers of find change grep options to false
	set include locked layers for find of find change grep options to false
	set include locked stories for find of find change grep options to false
	
	--Do It
	change grep
	
	set find grep preferences to nothing
	set change grep preferences to nothing
	
end tell

This is working for me as a clean up on the structure and formatting, however I would now like to process the AM and PM based on the times (Rule all First & Last Race times will always be PM, Gates Open can be both)

What I’m thinking is to get the times grep returns, query them, then set Am or PM to the string depending on the result.

My problem!

When I

return find grep preferences

I get this

{text from character 16 to character 61 of story id 191 of document "Gates Grep.indd" of application "Adobe InDesign CS3", text from character 16 to character 66 of story id 379 of document "Gates Grep.indd" of application "Adobe InDesign CS3"}

I would like to get the separated numbers and put them in to a list

eg. {“1”,“23”, “4”,“56”,"7,“12”}

Thanks for any help on this

LJ