Bug: 'Copy As AppleScript' fails to copy links within groups

If we use Copy As AppleScript to copy a grouped set of shapes which are linked by connectors, it copies the shapes and lines in the Group, but fails to copy their connections (the source and destination links of the connectors are all broken – the code fails to generate corresponding assignments to source and destination in a grouped context, while it does do this in other contexts).

This is clearly a bug in the implementation of Copy As AppleScript, rather than a limitation of the architecture or scripting interface:

  1. Grouping itself does not break these links – if we manually group, copy and paste a linked set of shapes, the pasted copy can then be ungrouped and the connections remain intact.
  2. It proves possible to write a simple Copy As JavaScript for groups which does not break the connector links within the group.