The same question was also asked in an other forum.
http://macscripter.net/viewtopic.php?id=36417
I posted a script but Nigel Garvey posted this more efficient one :
--{code}
property styleKeys : {{"#####", "Section"}, {"####", "Class"}, {"###", "Fee"}} -- NB. Style markers arranged longest to shortest.
on stylise()
tell application "Pages"
tell document 1
set paragraphTexts to paragraphs of body text
repeat with p from (count paragraphTexts) to 1 by -1
set paraText to item p of paragraphTexts
repeat with k from 1 to (count styleKeys)
set {marker, styleName} to item k of styleKeys
if (paraText begins with marker) then
set paragraph p of body text to text ((count marker) + 1) thru -1 of paraText
set paragraph style of paragraph p of body text to paragraph style styleName
exit repeat
end if
end repeat
end repeat
end tell
end tell
end stylise
stylise()
--{code}
Yvan KOENIG (VALLAURIS, France) samedi 2 juillet 2011 22:37:50
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !