As far as I know, there is no interface available between Pages and the Terminal.
As your late message gave your exact settings : Courier 10
I changed a bit my script.
Now it apply automatically your own settings.
To make it easy to customize, I defined the font name and the font size in properties.
--{code}
--[SCRIPT to_monospaced]
(*
Enregistrer le script en tant qu'application : to_monospaced.app
déplacer le fichier ainsi créé sur le bureau.
Glisser-déposer un ou plusieurs documents à importer dans Pages sur l'icône to_monospaced.app
Le script ouvrira ceux-ci dans Pages et appliquera la police non-proportionnelle définie dans le script.
--=====
Save the script as a application: to_monospaced.app
Move the newly created file on the Desktop.
Drag and drop one or several documents to import in Pages on the icon to_monospaced.app
The script will open the documents and apply the monospaced font defined in its code.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/06/16
2011/06/19 apply Courier 10
*)
--=====
(*
Here is a list of 17 monospaced fonts available on my machine.
"AndaleMono"
"Chicago"
"Courier"
"CourierFinalDraft-Bold"
"CourierNewPS-BoldMT"
"CourierStd-Bold"
"DejaVuSansMono-Bold"
"DroidSansMono"
"FreeMono"
"LMMono10-Regular"
"LeftistMonoSerif"
"LiberationMono"
"Menlo-Italic"
"Monofur"
"Monoxil"
"TeXGyreCursor-Regular"
"VerilySerifMono"
Of course, you may edit the two properties to fit your needs.
*)
property la_police : "Courier"
property le_corps : 10.0
--=====
on open sel
copy sel to les_documents
repeat with un_fichier in les_documents
my traite(un_fichier as text)
end repeat
end open
--=====
on traite(le_fichier)
(*
require the properties la_police and le_corps
*)
tell application "Pages"
try
openfilele_fichier
tell document 1 to tell body text
set properties to {font name:la_police, font size:le_corps}
end tell -- document…
end try
end tell -- Pages
end traite
--=====
--[/SCRIPT]
--{code}
As you may see, I'm systematically using handlers which are easy to test and reuse.
If you really want to spare some 1/1000 seconds you may use this more compact version :
--{code}
--[SCRIPT to_monospaced]
(*
Enregistrer le script en tant qu'application : to_monospaced.app
déplacer le fichier ainsi créé sur le bureau.
Glisser-déposer un ou plusieurs documents à importer dans Pages sur l'icône to_monospaced.app
Le script ouvrira ceux-ci dans Pages et appliquera la police non-proportionnelle définie dans le script.
--=====
Save the script as a application: to_monospaced.app
Move the newly created file on the Desktop.
Drag and drop one or several documents to import in Pages on the icon to_monospaced.app
The script will open the documents and apply the monospaced font defined in its code.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/06/16
2011/06/19 apply Courier 10
*)
--=====
(*
Here is a list of 17 monospaced fonts available on my machine.
"AndaleMono"
"Chicago"
"Courier"
"CourierFinalDraft-Bold"
"CourierNewPS-BoldMT"
"CourierStd-Bold"
"DejaVuSansMono-Bold"
"DroidSansMono"
"FreeMono"
"LMMono10-Regular"
"LeftistMonoSerif"
"LiberationMono"
"Menlo-Italic"
"Monofur"
"Monoxil"
"TeXGyreCursor-Regular"
"VerilySerifMono"
Of course, you may edit the two properties to fit your needs.
*)
property la_police : "Courier"
property le_corps : 10.0
--=====
on open sel
tell application "Pages"
repeat with un_fichier in sel
try
open file (un_fichier as text)
tell document 1 to tell body text
set properties to {font name:la_police, font size:le_corps}
end tell -- document…
end try
end repeat
end tell -- Pages
end open
--=====
--[/SCRIPT]
--{code}
Yvan KOENIG (VALLAURIS, France) dimanche 19 juin 2011 14:31:11
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
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 !