Here is a script which may be useful if your problem surface again.
--{code}
--[SCRIPT words_attributes_to_Style]
(*
Enregistrer le script en tant que Script : words_attributes_to_Style.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDĂ©marrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
Il vous faudra peut-ĂȘtre crĂ©er le dossier Pages et peut-ĂȘtre mĂȘme le dossier Applications.
Ouvrir un document Pages contenant des mots soulignés
Aller au menu Scripts , choisir Pages puis choisir âwords_attributes_to_Styleâ
Le script appliquera :
le style "Souligné" aux mots soulignés
le style "Accentuation" aux mots en gras
le style "Italic" (si vous l'avez créé) aux mots en italique.
--=====
Lâaide du Finder explique:
LâUtilitaire AppleScript permet dâactiver le Menu des scripts :
Ouvrez lâUtilitaire AppleScript situĂ© dans le dossier Applications/AppleScript.
Cochez la case âAfficher le menu des scripts dans la barre de menusâ.
Sous 10.6.x,
aller dans le panneau âGĂ©nĂ©ralâ du dialogue PrĂ©fĂ©rences de lâĂditeur Applescript
puis cocher la case âAfficher le menu des scripts dans la barre des menusâ.
--=====
Save the script as a Script: words_attributes_to_Style.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.
Select a Pages document embedding underlined words
Go to the Scripts Menu, choose Pages, then choose âwords_attributes_to_Styleâ
The script will apply :
the named style "Underlined" to the underlined words
the named style "Emphasis" to bolded words
the named style "Italic" (assuming that you defined it) to italicized words.
--=====
The Finderâs Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the âShow Script Menu in menu barâ checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editorâs Preferences dialog box
and check the âShow Script menu in menu barâ option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/11/13
2011/11/13 enhanced by Nigel Garvey in : http://macscripter.net/viewtopic.php?pid=145883#p145883
*)
--=====
on run
set Underlined_loc to my getLocalizedStyleName("Pages", "Blank.template", "STYLE_Underline")
set Emphasis_loc to my getLocalizedStyleName("Pages", "Blank.template", "STYLE_Emphasis")
tell application "Pages" to tell document 1
set character style of words whose underline type is single underline or underline type is double underline to character styleUnderlined_loc
set character style of words whose bold is true to character styleEmphasis_loc
(*
Assuming that you defined your own Italic style named "Italic", you may use : *)
try
set character style of words whose italic is true to character style "Italic"
end try
end tell
end run
--=====
(*
Example
set Heading8_loc to my getLocalizedStyleName("Pages", "STYLE_Heading 8")
Requires :
getLocalizedName()
*)
on getLocalizedStyleName(theApp, tName, x)
activateapplicationtheApp
tell application "System Events"
(application file of application process theApp as text) & "Contents:Resources:Templates:" & tName & ":Contents:Resources:"
return my getLocalizedName(theApp, x, result)
end tell
end getLocalizedStyleName
--=====
on getLocalizedName(a, x, f)
tell application a to return localized string x from table "Localizable" in bundle file f
end getLocalizedName
--=====
(*
List of default styles embedded in the Blank template :
"STYLE_Body" = "Corps";
"STYLE_Body Bullet" = "Puce du corps de texte";
"STYLE_Bullet" = "Puce";
"STYLE_Caption" = "LĂ©gende";
"STYLE_Emphasis" = "Accentuation";
"STYLE_Footnote Text" = "Texte de note de bas de page";
"STYLE_Free Form" = "Format libre";
"STYLE_Harvard" = "Harvard";
"STYLE_Header & Footer" = "En-tĂȘte et bas de page";
"STYLE_Heading 1" = "Sous-section 1";
"STYLE_Heading 2" = "Sous-section 2";
"STYLE_Heading 3" = "Sous-section 3";
"STYLE_Heading 4" = "Sous-section 4";
"STYLE_Heading 5" = "Sous-section 5";
"STYLE_Heading 6" = "Sous-section 6";
"STYLE_Heading 7" = "Sous-section 7";
"STYLE_Heading 8" = "Sous-section 8";
"STYLE_Heading 9" = "Sous-section 9";
"STYLE_Legal" = "LĂ©gal";
"STYLE_None" = "Aucun";
"STYLE_Normal" = "Normal";
"STYLE_Normal 22" = "Normal 22";
"STYLE_Normal 4" = "Normal 4";
"STYLE_Normal 8" = "Normal 8";
"STYLE_Numbered List" = "Liste numérotée";
"STYLE_Series_0" = "Series_0";
"STYLE_Series_1" = "Series_1";
"STYLE_Series_2" = "Series_2";
"STYLE_Series_3" = "Series_3";
"STYLE_Series_4" = "Series_4";
"STYLE_Series_5" = "Series_5";
"STYLE_Strikethrough" = "Barré";
"STYLE_TOC" = "Table des matiĂšres";
"STYLE_TOC Heading 1" = "Sous-section 1 de table des matiĂšres";
"STYLE_TOC Heading 2" = "Sous-section 2 de table des matiĂšres";
"STYLE_TOC Heading 3" = "Sous-section 3 de table des matiĂšres";
"STYLE_TOC Heading 4" = "Sous-section 4 de table des matiĂšres";
"STYLE_Title" = "Titre";
"STYLE_Underline" = "Souligné";
"STYLE_[Null]" = "[Nul]";
*)
(*
You may use more sophisticated custom styles embedding several properties:
baseline shift (real) : Raise or lower the target text.
bold (boolean) : Whether the font style is bold.
capitalization type (all caps/normal capitalization/small caps) : Whether a capitalization style is applied.
character background color (color) : The color of the character's background.
color (color) : The color of the font.
font name (text) : The name of the font.
font size (real) : The size of the font.
italic (boolean) : Whether the font style is italic.
ligatures (all ligatures/default ligatures/none) : Remove ligatures from the target text if the document is set to use ligatures.
name (text) : The name of the style.
outline (boolean) : Whether the font style is outline.
shadow (boolean) : Whether the text box content casts a shadow or not.
shadow angle (real) : The directional angle, in degrees, that the shadow is cast.
shadow blur (integer) : The relative amount of blur of images seen through the shadow.
shadow color (color) : The color of the shadow.
shadow offset (real) : The offset from the text box content that the shadow extends to.
shadow opacity (real) : The amount of opacity for the shadow, in percent.
strikethrough color (color) : The color of the strikethrough line(s).
strikethrough type (double strikethrough/none/single strikethrough) : Whether one or more lines are drawn through the characters.
subscript (boolean) : Decrease the font size and lower the baseline of the text.
superscript (boolean) : Decrease the font size and raise the baseline of the text.
tracking (real) : The space between text characters, in percent.
underline color (color) : The color of the underline(s).
underline type (double underline/none/single underline) : Whether the font style is underline.
*)
--[/SCRIPT]
--{code}
Yvan KOENIG (VALLAURIS, France) lundi 2 janvier 2012
iMac 21â5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : http://public.me.com/koenigyvan
Please : Search for questions similar to your own before submitting them to the community
For iWork's applications dedicated to iOS, go to :
https://discussions.apple.com/community/app_store/iwork_for_ios