Can Mac Pages format superscript numbers sequentially?

I have a very long academic document with lots of references. For now I have used the normal * as a placeholder for where the superscript number should be. I have then attached the reference text as a 'comment' to the asterisk. So now I can see all my dosument with the references in the comment pane.


But how do I change all those asterisks to be incremental superscript numbers? How do I format the document so the comments appear at the bottom of each page, where they relate to the superscript numbers.


Do I need another app to do this?

MacBook Pro 16″, macOS 13.3

Posted on May 13, 2023 02:58 PM

Reply
Question marked as Top-ranking reply

Posted on May 14, 2023 05:51 AM

Let's say you have a document content like the following:



Each asterisk is a superscript, placeholder text, and has its own unique comment.


The following AppleScript will transform this into:



and the original comments are unaffected. This does not generate corresponding footnotes. The assumption is that the Pages document is already open before running the script. Tested: Pages v13 on macOS 13.3.1 (a).


Copy/Paste the following AppleScript into Apple's Script Editor:


use scripting additions

set place_character to "*"
set theTags to {} as list
set cnt to (1 as integer)

tell application "Pages"
	activate
	tell front document
		set theTags to the tag of every placeholder text whose tag contains place_character
		repeat with i from 1 to count of theTags
			set thisTag to (item i of theTags)
			set (first placeholder text whose tag is thisTag) to (cnt as text)
			set cnt to (cnt + 1) as integer
		end repeat
	end tell
end tell
return


1 reply
Question marked as Top-ranking reply

May 14, 2023 05:51 AM in response to smashingmickey

Let's say you have a document content like the following:



Each asterisk is a superscript, placeholder text, and has its own unique comment.


The following AppleScript will transform this into:



and the original comments are unaffected. This does not generate corresponding footnotes. The assumption is that the Pages document is already open before running the script. Tested: Pages v13 on macOS 13.3.1 (a).


Copy/Paste the following AppleScript into Apple's Script Editor:


use scripting additions

set place_character to "*"
set theTags to {} as list
set cnt to (1 as integer)

tell application "Pages"
	activate
	tell front document
		set theTags to the tag of every placeholder text whose tag contains place_character
		repeat with i from 1 to count of theTags
			set thisTag to (item i of theTags)
			set (first placeholder text whose tag is thisTag) to (cnt as text)
			set cnt to (cnt + 1) as integer
		end repeat
	end tell
end tell
return


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can Mac Pages format superscript numbers sequentially?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.