// Vor Ausführung Einfügemarke in Tabellenzelle platzieren! var doc = app.documents.firstItem(); var s = app.selection[0].insertionPoints.firstItem(); var cr_name = 'Seite'; var cr_format = doc.crossReferenceFormats.itemByName(cr_name); if (cr_format == null) { cr_format = doc.crossReferenceFormats.add({name:cr_name}); cr_format.buildingBlocks.add({blockType:BuildingBlockTypes.PAGE_NUMBER_BUILDING_BLOCK}); } var cr_source = doc.crossReferenceSources.add ( {sourceText:s, appliedFormat: cr_format} ); var cr_destination = doc.hyperlinkTextDestinations.add ( {destinationText: s } ); var cr = doc.hyperlinks.add ( cr_source, cr_destination ); var str = cr_source.sourceText.textVariableInstances[0].resultText; cr.remove(); cr_source.sourceText.remove(); cr_destination.remove(); alert('Seite: ' + str);
| 03.11.2023