Applescript Pages; Address book fields; clipboard

I have a Pages document with a Address Book fields. The formatted text can be copied to TextEdit then back to pages – and lose the Address Book field! This is exactly what I want for my script. TO DISABLE THE ADDRESS BOOK FIELD AFTER A MERGE.

  1. How do I copy the Pages selection to the clipboard, keep the rich text, and paste back into my Pages document without the application TextEdit? I remember some “copy clipboard” commands to strip rich text, but don’t remember any commands that strip other things.

  2. OR, What applescript command let’s me truly see the clipboard contents as there is obviously something else there when I copy the text with an Address Book field. I could then parse the clipboard contents with do shell script and sed.

_TIA

I might have been making this too hard, as I came up with this…

Set up: Add a Text box in Pages with Address Book fields (Lastname, Firstname, etc.)
Run this applescript and the clipboard strips the address book fields.


-- Delete Address book fields (after a merge ) leaving font,color formatting intact
tell application "Pages"
	activate
	select the object text of text box 1 of body text of document 1 --contains Address Book fields
	
	tell application "System Events" to keystroke "c" using {command down}
	
	set clip to (the clipboard as record)
	set the clipboard to clip
	
	tell application "System Events" to keystroke "v" using {command down}
	
end tell

One thing I didn’t intend for it to strip is Pages:Format:Font:Capitalization: All Caps. Anyone know how to fix this?

_TIA