How to add word count to Pages document footer?
Can't add my word count to the pages footer.
[Re-Titled by Moderator]
Can't add my word count to the pages footer.
[Re-Titled by Moderator]
Pages can display the word count in a floating panel at the bottom of the document but that word count is not user-assignable to the document body, header, or footer panels.
In Finder, press shift+cmd+U to open the Utility folder. Double-click the Script Editor application to launch it.
Copy/paste the following AppleScript code into the script editor, click the hammer icon to compile it, and then click Run. This will prompt you to select a Pages document (only), open that document, and display the same word count as Pages shows in its floating count panel. You can select, copy, and paste that integer word count from the AppleScript dialog into the Pages footer.
This script counts words in the user's default language.
-- Pages_wordcount.applescript
use framework "Foundation"
use AppleScript version "2.5"
use scripting additions
property ca : current application
set thisDoc to (choose file of type {"com.apple.iwork.pages.sffpages"})
tell application "Pages"
activate
open thisDoc
tell front document to set T to its body text
close front document
end tell
tell application "Pages" to if it is running then quit
set wordcount to (ca's NSSpellChecker's sharedSpellChecker)'s countWordsInString:T |language|:""
tell application "Finder"
display dialog (wordcount) as text with title "Document Word Count"
end tell
return
How to add word count to Pages document footer?