0

How to add InDesign special characters like auto-page-numbers to textframes when using Python for scripting InDesign? With JS you could do:

aTextFrame.contents = SpecialCharacters.autoPageNumber
Community
  • 1
  • 1
Rockbot
  • 935
  • 1
  • 6
  • 24
  • In the InDesign search dialog box you can find the page number markers with `^N`. So perhaps `aTextFrame.contents = "^N"` or somehting similar *may* work. Disclaimer: I don't know Python. – cybernetic.nomad Aug 18 '18 at 14:18
  • @cybernetic.nomad `'^M'` would be what I want to use, but it appears as string. – Rockbot Aug 18 '18 at 14:44

1 Answers1

2

The constant for special character auto page number marker is

idAutoPageNumber = 1396797550 # from enum idSpecialCharacters

See doc_reference for complete Python Scripting object definitions for InDesign

To add the special character to a textframe:

aTextFrame.contents = idAutoPageNumber
joke4me
  • 812
  • 1
  • 10
  • 29