Hi, Fred:
This is a brainstormed suggestion, so reality may frown on using it. But it might work with a finite and reasonable number of codes in content that needs to be round-tripped, or to which additional coded content will be imported.
The basic premise is that the source content codes are text. If they are not, then the non-text codes need to be something that ID retains when the content is placed, and something that ID can search and replace. If this isn't the case, the codes will need to be replaced with text identifiers before placing.
* In a new ID document named "active codes," create a text variable for each code - if start and end codes are different, create one for each. Name these text variables clearly, of course.
* Before adding definitions to the text variables, save a copy of this document as "blank codes."
* Back in the active codes file, define each text variable as the appropriate code and save the file.
* In a document (not active codes or blank codes), place the source content that contains codes.
* Perform Type > Variables > Define > Load, and navigate to the active codes file to import the text variables.
* Convert each code in the imported source text to the matching text variable.
One efficient approach might be to search for a start code text and replace
it with the start variable, then lather, rinse, repeat for each code. I
believe there's a find/replace from list script or third-party plug-in for
this that could automate the process.
This operation embeds variables that can contain codes or nothing.
* Save the file.
* To hide the embedded codes, load the variables from the blank codes file. The codes will disappear, but the empty variables will remain in place.
* To restore the embedded text variable codes, load the variables from the active codes file.
* To prepare ID content that contains text variable codes in a form for editing in the source format, perform Type > Text Variables > Define, select all variables in the list, then click Convert to Text, then export.
* Back in the source application, if plain-text codes are appropriate, you're done; if not, you need to replace the plain-text codes with their matching code markers.
I don't know enough scripting to know if this can be scripted. Perhaps try it out in the scripting forum.
HTH
Regards,
____________________
Peter Gold
KnowHow ProServices