Saturday, November 01, 2008

OpenOffice 3.0 and Pages 3.0 comparison

This comparison is inspired by Wikipedia's Word vs. Pages comparison, but it is about OpenOffice instead of Word, and it contains some personal observations. It does not cover all the differences, but only some I consider important or interesting. The points are not ranked but just listed in a random order.

The current price for iWork '08 (with Pages 3.0) is close to 80 euro. The price for OpenOffice is 0 euro.

In OpenOffice but not Pages
  • Open and save OpenDocument files
  • Native "Save" of RTF and Word format (Pages "exports" to RTF and Word format, but subsequent changes have to be exported again through a number of dialogue steps.)
  • HTML editing
  • Document comparisons
  • Multiple windows with the same document (However, there is no split window, as far as I can tell.)
  • Multiple versions (Pages stores only one version of the document in each file)
  • AutoSave
  • Master documents
  • Script recording (Called “macros” in OpenOffice. The language is OpenOffice Basic by default. Applescript is not supported.)
  • Connector points for objects in diagrams.
  • Drop caps
  • Italics and bold in fonts with no built in typeface for it.
  • Hidden text
  • Paste Special - for pasting a chart as an image
  • Bibliography databases
  • Vertical Script and Japanese furigana
  • Support for right-to-left scripts, like Arabic and Hebrew
  • Built in formula editor
In Pages but not OpenOffice
  • Save and open Pages documents
  • Save and open RTFD files
  • Support for Mac OS X Services
  • Image Masks
  • Usable image controls. (OpenOffice actually has plenty of controls to edit images, but they are so stone age like, that they are virtually impossible to use.)
  • Multi-language dictionary (OpenOffice has several language dictionaries, but for each part of the text, one has to decide which language it shall be checked against.)
  • Ligatures and other advanced typographic features
Neither application seems to have anything like Microsoft Word's WordArt module.

Looking at the usefulness of the functions, it would seem like OpenOffice is much better. Most of the functionality that is unique to Pages is cosmetic or largely irrelevant to most people. Even if Pages is better at editing images, anyone who really cares about images will have to have an external dedicated image editor anyhow.

However, using the two programs there is a huge difference in perception. OpenOffice feels slower. There are a few milliseconds before the characters are displayed after each keystroke. It is more difficult to find options, and what is implemented is usually done in a strange way. There is for example a function called Conditional Text. To use it you have to start by following the menu path Insert > Fields > Other, and then click the Variables tab. As far as I can tell, none of those labels have anything to do with conditions or text.

In other words, OpenOffice is not a program to have fun with.

Wednesday, October 08, 2008

How do I get svg files into Pages?

SVG files are "images" which can be resized without losing any information. They can be created by programs like OpenOffice (the drawing module), Inkscape or Adobe Illustrator.

Often the program that created them can also save to PDF, which Pages handles directly, and that is then an easier solution.

However, there is a way to import black and white SVG files to Pages with the help of some other programs. It it may be cumbersome, the first time you set it up, and you will have to type commands in the Terminal, but it does work.
  1. Download the program svg2key and follow the corresponding instructions at http://mcb.berkeley.edu/labs/zusman/dave/svg2key/ .
  2. Run the program on the SVG you want to import to Pages.
  3. You will get a Keynote file. Open it in Keynote.
  4. Copy the content and paste it into Pages.
(Images are usually stored inside the Pages file "package" as separate objects. However SVG objects are stored inside the index.xml file in the package, just like "shapes", text and style information. As far as I can tell, they appear within the tags SFDBezierPathSource.)

Saturday, October 04, 2008

Which are my preferences?

If you have Pages running fine for one user on one computer, but you have problems on another, it is possible that the preferences are corrupted.

The quickest and dirtiest way to check this is to delete the preference file -homedirectory-/Library/Preferences/com.apple.iWork.Pages.

However, if you want to check for the exact difference in preferences between the two files you can follow the following steps.

  1. Launch the Terminal (Application > Utilities > Terminal).
  2. Type the command defaults read com.apple.iWork.Pages |less
  3. Hit enter.

You will now get a list of all preferences set for Pages for the active user. It will look something like this:


{
"AppleNavServices:PutFile:0:Disclosure" = <01>;
"AppleNavServices:PutFile:0:HomeDirectoryPath" = "file://~/Desktop/";
"AppleNavServices:PutFile:0:Path" = "file://localhost/Users/Magnus/Desktop/";
"AppleNavServices:PutFile:0:Position" = <01b201ba>;
and so on...


To move to the next page, press space. To move up one page, type b. To get more information about navigating around, press h. To leave the display to be able to type another command, type q.


Using the command defaults you can also change individual values, if needed.

Warning! When you change those values by hand, you may make things worse than they were before, unless you are careful. Make sure you know what you are doing. You can try the commands out in a test account, before you change things in the main account, if you are unsure.

Let's say that you are interested in the following preference:
MediaBrowserVisibility = 0;
You realise that means that the Media Browser is invisible in Pages. (It actually means that it is invisible by default, when Pages starts.) To change it to visible, you type the following text. The full line may not display well in your browser, but you can copy the line. When you paste it in Terminal, it will paste the full line.
defaults write com.apple.iWork.Pages MediaBrowserVisibility 1
Next time you open Pages the Media Browser will be visible.

defaults write com.apple.iWork.Pages MediaBrowserVisibility 0
And it will be invisible next time you open Pages.

Remember that you will have to close Pages and reopen it for it to take the changed values into account.

Thursday, July 10, 2008

Using Aperture with Pages

There are some hints how to use Aperture with Pages at the blog Photo Phindings.

Monday, June 09, 2008

index.xml.gz and corruption

Under certain non-identified circumstances the file index.xml.gz can be corrupted. According to posts in Apple's discussion forums by Yvan Koenig, who usually knows what he is talking about, the corruption can be avoided by using Save As... instead of Save. The conclusion is to make frequent Save As... actions as backups, if you work on important large documents.

To rescue some information from a corrupted document, you can right click (ctrl-click) on the corrupted document and choose "Show package content" and look for a file called index.xml or index-new.xml. Copy the xml file to the desktop (for example) and open it with TextEdit. The content does not look nice, but text you have entered is partly readable.

If you only have a file called index-new.xml you can try the following steps:
  1. Copy the entire corrupted document, so you have a backup just in case.
  2. Rename the file index-new.xml to index.xml (with or without gz depending on the original).
  3. Open the file in Pages.
If you are lucky that works.

Saturday, May 17, 2008

TextEdit and Styles

In case you use TextEdit as well as Pages, you will have noticed that TextEdit has an unusual and sometimes buggy way of handling styles.

If you click on the "Styles" control in TextEdit's toolbar, you will at first only see Favorite Styles.



A Favorite Style can be used in any TextEdit document for this user on this computer, but nowhere else. It is stored in the hidden file .GlobalPreferences.plist.

If you click on "Other...", you will get to a window where you can see the Document Styles. In contrast to almost all other programs, a Document Style in TextEdit has no customisable name.



It just contains some sample text ("ONE" in the picture above), which has a particular format. All formats used in the document appear as you click the arrows back and forth.

To create a Favorite Style from the current format, click on the button "Add To Favorites" and give it a name, and choose if you want the font and ruler information to be part of the style.

To delete a Favorite Style, click on the radio button Favorite Styles, select the style you want to delete and click on Remove From Favorites.



If you click on Select, you can choose to select where the style is used, based on different criteria.



You click on Apply, the active style is applied to the currently selected text.

Done in the Style window just closes the window.

If you do not have the Ruler active, you can still use Styles with the menus: Format > Font > Style

There is no easy way to edit an existing Favorite Style. The steps are:
  1. Apply the style to some text.
  2. Modify the text to the new format you want.
  3. Add the new format as a new Favorite Style with the same name as the old style.
  4. Accept the warning that you are replacing an existing style.
There is no way of telling which style is applied to a particular piece of text. That information is not stored and not displayed.

Personally, I think it is questionable if TextEdit's styles are better than no styles at all. It is clear that there has been some development effort, but the design does not seem to have gone through any usability tests. Still, if they fulfill any of your particular needs, there is of course no harm in using them.

Sunday, April 06, 2008

i

Several languages, like Catalan, Croatian, Italian and most Scandinavian languages have a word that consists of the single letter "i".

The problem is that if you launch Pages 3.0 or Pages 4.0 in English and have switched on Fix Capitalization in the preferences, then the word "i" will automatically become "I", even if you type in another language than English. The Danish (and Norwegian and Swedish) phrase "gå i land" will become "gå I land".

The silly thing is that Pages assumes that you want the capitalisation rules of the language you run the software in - not the language you set in Inspector > Text > more.

There are a few solutions here.
  • Switch Fix Capitalization off.
  • Launch Pages in a non-English language, like French, Italian or German. (Drag the language to the top in System Preferences > International > Languages, before you launch Pages.)
  • Hack. This is one of those things that can go seriously wrong unless you are careful, but if you succeed things will work fine:
    1. Control-click on the application Pages, and choose "Show Package Contents".
    2. Go to /Contents /Frameworks /SFWordProcessing.framework /Versions /A /Resources /English.lproj.
    3. Make a copy of AutoCorrect.plist as a backup and put it for example on the Desktop, in case things go wrong.
    4. Open the file AutoCorrect.plist with for example TextEdit. You will find two lines with the following text somewhere in the file under capitalizationDictionary: <key>i</key> <string>I</string>
    5. Remove that text. Save the file.
    6. Relaunch Pages.
The inconvenience here is that even if you type in English, it no longer will correct i to I.

Wednesday, April 02, 2008

Pages crashes. What should I do?

Just like any application on any operating system, Pages may crash on you - or "quit unexpectedly", as the politically correct term is. To some of us that happens not even once a year. To some of us it happens every time we try to edit a table or access the colour dialogue or whenever we try to save a file. Perhaps Pages will not even start. You may get confusing messages about the SFWordProcessing plugin or EXC_BAD_ACCESS or KERN_INVALID_ADDRESS or EXC_BREAKPOINT, which will invoke memories of that DOS PC you used to have 20 years ago.

These are some of the things you can do to fix or isolate the problem. You can do them in any order you like.
  • In /Library/Caches (in the root of your harddisk), trash the files ending with .csstore and then restart.
  • In ~/Library/Caches/ (under your home directory), trash com.apple.iWork.Pages.plist .
  • In ~/Library/Preferences (under your home directory), trash com.apple.iWork.Pages.plist .
  • Remove any third party applications like spellcatcher.
  • Clean up your spelling tools.
  • Open FontBook, select all fonts and then File > Validate Fonts.
  • Reset the font cache.
  • Use another account than your main one. If that works, you know that the problem is in your main account. In your main account try removing file by file from ~/Library until things work. Try to remove them in an intelligent way. For example: create a new folder under Preferences called "old preferences" and drag every file that was in preferences into the new folder and then restart. After the restart you can drag the files back from "old preferences" to "Preferences" one by one, until things crash. Then you have found an offending file.
  • Repair permissions from Disk Utility. Also verify your disk, just in case.
  • Disable Spaces, if you have it active.
  • If you run Pages from an external drive - don't. Copy it to your harddisk and run it from there.
  • If you use Toast Titanium, something strange may be happening with the DivX plugin. Try reinstalling Toast with and without the DivX plugin, and see if that improves things.
  • Delete iWork and reinstall it from the installation DVD.
  • If nothing else works, reformat the harddisk and re-install the system. Do not add any additional fonts or programs. Just start Pages. If it still crashes, you are very likely to have a hardware problem and should bring the Mac to a service provider.

Sunday, March 23, 2008

Print shops and embedded fonts

With some print shops you may get an error back saying something like "This file was created with Mac OS X 10.4.11 Quartz PDFContext / Pages. We cannot print files created with this application."

Mac OS X embeds several subsets of the same font, just like many other applications. However, for some reason some printers (like Lulu) are not able to handle the way Mac OS X does it.

A solution that in some cases works is to create the PDF using Print > PDF > Print to PDF-X. In contrast to a standard PDF, which can be used for many purposes, a PDF-X file is dedicated to facilitate printing.

You can find some more information at the following sites:

Sunday, March 02, 2008

How do I type Wingdings in Pages?

Wingdings and Webdings are fonts with small images instead of the letters. My personal recommendation is that you do not use them, even if you have the fonts. This is why:

Every document you type will be read by someone - either by someone else or by yourself in a few minutes, days or years. A document you type with Latin letters or any standard unicode letters is likely to be legible by anyone with the right software - today and in the future. But Wingdings is not standard unicode.

Now, let's assume that you want to show the yin-and-yang symbol to a reader.


You know that it is part of the Wingdings font, so you decide to get the symbol there.

So what you can do is to activate the Keyboard Viewer. Then select Wingdings from the menu in the bottom left corner and then select Wingdings as font in Pages and start typing.


However, when you send this Pages document to another computer user, it is very possible that he will not have the Wingdings font, so the character will not display. What is displayed is just "[" because that is the character that Wingdings uses to display the yin-yang symbol.

And the same thing can happen to you. When you change the paragraph style in this document, the symbol will become "[". If you copy the text to another application, it will become "[". If you export it to RTF and then open it in TextEdit, it will become "[". It is basically a very unstable character - just like all other characters in Wingdings, Webdings and Monotype Sorts.

TextEdit does not even allow you to type the character, and that is probably a wise choice. You can insert it from the Character Palette to TextEdit. You find it in the Character Palette with the View PIFonts, Font: Wingdings-Regular. However, what is inserted is the unicode F05B which is in the Private Area. The Private Area means that it can be used by anyone for anything, so depending on the available font, it can appear as completely different characters.


As you do not know which font the reader will have available, you will not know what the document will look like to him. That's why it usually is best to avoid Wingdings fonts altogether.

There are perhaps cases where you need to use them, but try to make sure you have a normal picture as a backup - just in case. You can also use Wingdings to create PDF files, as PDFs usually embed the font.

Saturday, March 01, 2008

How do I import and export text files in different encodings?

Pages does not pretend to be a text editor. If you want to edit text files, you are much better off using TextEdit or other programs.

When you Export a text file from Pages, it usually uses either Western (Mac OS Roman) or unicode UTF16 as encoding. You cannot choose which encoding you want, and you cannot for sure tell what encoding it was, unless you verify in some other program like TextWrangler.

When you import text files, Pages can usually open UTF16 without any problem and usually also Western (Mac OS Roman). Pages is unable to open the common UTF8 format.

The workaround is to always use TextEdit or another program for text files. You can then copy the content to Pages - if you want to.

Thursday, February 28, 2008

How do I create my own Color Palette?

Sometimes you may want to use a limited number of colours for a document. Let's for example say that you want certain words in blue. If you use the standard Color Wheel in the color window (View > Show Colors), you may end up with slightly different shades of blue, depending on where you click.


To be sure that you always select the same colour, you can drag colours from the rectangle next to the magnifying glass to the strip at the bottom of the window.



The strip contains 15 squares by default, and that should be more than enough for most people. However, if you need more, you can drag the the dot below to make room for more squares.



You may need several sets of colours. Let's for example say that you want one particular set of three colours in one document but another set of three colours in another document. You can handle that as well in the Color window, using the third tab, called "Color Palettes".



Here you can choose between a few pre-defined palettes, like Apple, Web Safe Colors or Developer, but you can also create your own ones, clicking on the wheel, and choosing "New".



You can of course rename both the colours and the colour palettes to whatever names you like.




So, how do you select colours for your palettes? You can do this in (at least) two ways.

One is to click on the magnifying glass and then click on an area of the screen that has a colour you want to capture.



The other method is to select a colour using one of the other icons on the top. Then go back to the "Color palettes" icon.

After you have selected a colour, you drag it into the empty area of your palette or click on the + button. That's it. You do not even have to save, as the colour palette has auto-save (in contrast to Pages documents).

Tuesday, February 26, 2008

What are the most frequent of the frequent questions?

It is very difficult to tell what the most frequently asked questions are about Pages. Looking at Apples Discussion forums one can get one impression. Looking at this blog a different one.

This is a graph of the most common keyword categories that have led people to this blog this February 2008:



The most common keyword is about a missing function: autosave. One out of eight people who find this site with a search engine come here because they miss an autosave function.

The next keyword is about possibilities: applescript. That is actually good news - people want to extend and adapt the program for their own needs.

The following point, however, is again about a missing function: wordart. It may be questionable if it would make sense to include a word art module in Pages, but it is not questionable if it is an often wished for function.

The next one is again about missing functionality, but it is not missing in Pages itself. A lot of people ask for means to read Pages files on Windows or on Macs, where Pages is not installed. Most often, what they dream of is a viewer.

The following three points, rotations (of graphics, tables, text), attachments to mails and a mean to set a default font, are all available, but the user interfaces of Pages and Mac OS X are not intuitive enough for everyone to find the functions.

The last one in the diagram is password protection, something many programs offer from within the program itself. When it comes to iWork, however, password protection has to take place in an external program, Disk Utility.

There are plenty of other searches that lead to this blog - about fonts, typography, colour schemes, Japanese features, and so on.

My own wish would be that Pages one day will be so intuitive and powerful that this kind of blog has no purpose any more. However, that does not seem to happen any time soon.

Sunday, February 24, 2008

Why can't I Copy a Character Style?

Sometimes the menu item Format > Copy Character Style is greyed out, even though you know you have changed something in the formatting.

The most likely reason is that you changed formatting for the paragraph, but not for the character - at least not directly.

Here the paragraph is selected:
Note the character at the end of the word.

Here just a word is selected:
Change formatting for the paragraph, and the Character Style is not updated. Change formatting for a word or individual characters, and the Character Style is updated and can be copied.

Thursday, February 14, 2008

Smart quotes, do they work?

In Pages Preferences > Auto Correction, you can select "Use smart quotes", which automatically turns " to “ or ” depending on the context, so "hello" becomes “hello”. This works fine for English. However, in many other languages the rules are different so quotation marks and apostrophes can be some of the following characters in different combinations:

‚ „ ’ ” “ « » ‹ ›

Smart quotes work the English way, when you run Pages in English or any other language except German. When you run it in German it applies the quotation marks like this: „hallo“, which is correct for German.

Pages gets this information from the language in System Preferences > International > Language. It does not get it from the language set in the Inspector > Text > More.

This is sometimes exactly what you want. If you write an English text and add a German quotation, you may not want a German Anführungszeichen for that single phrase.

In many cases you have to type the characters manually. This is the case if you want to type «guillemets», like in French or Italian.

To find out how to type a character with your particular keyboard layout, use the Keyboard Viewer.

Wikipedia has much more information regarding the use of quotation marks or apostrophes.

Sunday, February 10, 2008

How do I select all instances of font X?

Paste and run the following script in Applications > AppleScript > Script Editor:
tell application "Pages"
select (every character of body text of front document whose font name is "Times-Roman")
end tell
Note that the font name may not be what you expect. The script above searches for the font "Times", even though the name in the script is "Times-Roman". If you type just "Times", it will not work.

If you need help to see what font name AppleScript expects, mark the first word of Pages front document in the desired font, and run this script:
tell application "Pages"
display dialog (font name of word 1 of body text of front document as string)
end tell


(Sorry for the bad formatting above. Blogspot is not made to display source code. However, even if you cannot see the last characters on all rows, they should paste fine when you copy them.)

Saturday, February 09, 2008

Resizing pictures with AppleScript

If you resize a picture inside a Pages document, it will just look like it is smaller. In reality, it takes up as much diskspace as before. You have not lost any information. However, sometimes you really need to free up some diskspace, and you need to resize the picture for real. The most obvious tool to do this is Preview (Tools > Adjust size).

However, there are a few other options to use. The following is a script to resize pictures using AppleScript only. There is no real UI at all. It resizes the image to the value of "targetSize" - in this case 240. If you want to resize it to some other value, just change the script.

1. Open Applications > Utilities > Applescript Editor. (Path in older versions of Mac OS X: Applications > Applescript > Script Editor.)

2. Create a new script and paste the following code:
on open theImages
repeat with anImage in theImages
tell application "Image Events"
--Set the maximum dimension of the picture.
-- If it is in landscape mode, it is the width.
-- If it is in portrait mode, it is the height.
set the targetSize to 240
set currentImage to open anImage
set imageType to currentImage's file type
scale currentImage to size targetSize
tell application "Finder" to set newImage to (container of anImage as string) & "scaled " & (name of anImage)
save currentImage in newImage as imageType
end tell
end repeat
end open
3. Save the script as an "Application".

4. Drag your image to the new script Application.

You will get a new file with the new dimension.

If you prefer to scale to a certain percentage, use this script instead:
on open theImages
repeat with anImage in theImages
tell application "Image Events"
-- Set the variable targetSize to the scale factor. 0.5 means 50%.
set the targetSize to 0.5
set currentImage to open anImage
set imageType to currentImage's file type
scale currentImage by factor targetSize
tell application "Finder" to set newImage to (container of anImage as string) & "scaled " & (name of anImage)
save currentImage in newImage as imageType
end tell
end repeat
end open


The accepted image formats are BMP, JPEG, JPEG2, PICT, PNG, PSD, QuickTime Image and TIFF.

If you feel more comfortable with Automator, you can use that as well.

Friday, February 08, 2008

Resizing pictures with Automator

If you resize a picture inside a Pages document, it will just look like it is smaller. In reality, it takes up as much diskspace as before. You have not lost any information. However, sometimes you really need to free up some diskspace, and you need to resize the picture for real. You have to do that outside Pages. The most obvious tool to do is Preview (Tools > Adjust size).

However, there are a few other options to use. One is to use Automator.

1. Open Automator from your Applications folder.
2. Select "Custom" as starting point.


3. Click on Photos > Scale Images, and drag that icon to the empty workflow area to the right.
4. When you get a question if you want to add a Copy Finder Items action, accept it with "Add".


5. Set the scaling factor to the size or percentage you want to use.


6. Save the workflow as an Application - not a Workflow, which is the default in the Save dialog.


7. Drag an image to the new Automator workflow application.


You will get a new copy with the defined scaling. If you want to change scaling, you do not even have to leave Automator. Just open the workflow application in Automator by dragging it on the Automator icon. Change the value and save, and you are ready to scale again.

This will work with for example jpeg, png, tif or psd files.

It will not work for gif or raw image files.


If you want even more flexibility, you can use these AppleScripts.

Saturday, February 02, 2008

How do I display page numbers with Roman numerals?

Right click (or control-click) on an inserted page number and select the numbering type you want.

Friday, February 01, 2008

Where is the "Normal View"?

In Pages '09, version 4.0, the "Normal View" is in the menu View > Enter Full Screen.

The following was written for previous version of Pages.

In some applications, there is a mode in which you can ignore formatting and margins and concentrate completely on the text content. The most well known such mode is probably Microsoft Word's "Normal View". Even a dedicated layout program like Adobe InDesign has its "Story Editor". Unfortunately Pages has nothing like that. There is no way to hide margins and page breaks.

There are a few other programs that have a full screen view, where all distractions on the screen are hidden even more efficiently than in Word or InDesign. In these programs you see the text and nothing else. Even the menus are gone. Examples of such applications for Mac OS X are Scrivener, Nisus, WriteRoom and CopyWrite. None of them is free.

The Poor Man's Solution

However, there is also a free solution. You may not like it, but I will tell you anyhow. It is to go back to the stone age before graphical user interfaces. Follow these steps:
  1. Log out.
  2. Highlight one of the users, and type alt-Enter. You will now get fields to type Name and Password instead of choosing them from a list.
  3. In the Name field, type ">console" (without the quotation marks). Leave the password field blank.
  4. Press Enter. You are now in character based mode.
  5. Type your login name. (Not the free form one displayed in the Login window, but the name of your home directory.)
  6. Press Enter.
  7. Type your password.
  8. Press Enter. You are in! (If all went well.)
All you now need to do is to learn how to use a character based editor like emacs or vi.


You are now in the serene land of text only editing. There are no mail or chat programs to distract, no internet browsers, no bright colours - just letters and your creativity.

Once you are tired of text mode, you can return to the real Mac OS X by typing "exit" on the command prompt. A shortcut for this is to type ctrl-d.

Once you are back in Mac OS X, you can open the text file you created with emacs or vi and paste its content into a Pages document, to get the layout right. The result of your creativity deserves it.

Thursday, January 31, 2008

Why did Pages' characters look blurry?

With Pages 3.0 and earlier, many users perceived problems with blurriness around the characters. With Pages '09/Pages 4.0 Apple changed the way fonts are rendered, which makes them look darker or sharper than they did before.

The word below is written using Helvetica 10 and rendered at 100% size. The top rendering is Pages '09 and the lower one is Pages 3.0. Surprisingly the top rendering looks better on an LCD screen than the lower one.



This uses the default setting in System Preferences > Appearance > Font smoothing style. With Pages '09, this setting is taken into account, unlike previous versions.

If you want to turn font smoothing off, open a terminal window and use the command
defaults write com.apple.iWork.Pages SFRFontSmoothing 0
If you want to turn it back on, use the command
defaults write com.apple.iWork.Pages SFRFontSmoothing 1
The text below was written for previous versions. It contains more explanations of what was wrong.
---

Most letters have some round curves, and that is a problem, as current computer screens consist of a lot of small dots, not curves.

The process of mapping the round curves of letters to pixels is called font rasterisation. There are different strategies to do it.

Last millennium one of the most common strategies was to simply put black dots in logical places. AppleWorks uses that method, and the result is that the letters get very rough edges. Here is the word "lollipop" written in Helvetica, 10 in AppleWorks. It is magnified about 10 times, so you can see the pixels.
The next strategy was to use anti-aliasing. That means that you add pixels of different shades of grey to increase the illusion that the letters are curved. It looks ridiculous when you magnify it, but when the font is small, it is surprisingly efficient. It is very likely that your web brower uses anti-aliasing to display the characters you read right now. Magnified, the characters do not look very legible:

But on a screen, it does not look quite that bad:


This is still the most efficient strategy, if you have a CRT (Cathode ray tube) screen. It is also the method Pages uses. However, fewer and fewer people use CRT screens nowadays.

For LCD screens, the best strategy is usually subpixel rendering. This uses the fact that each pixel on an LCD screen consists of three small elements, one red, one green and one blue. Looking at a magnified image of these pixels gives the impression that it is almost illegible. However, when one takes into account that the colour elements are at different positions inside each pixel, it is easier to understand that this can actually be easier to read than plain anti-aliased text.

On the screen it looks a little better. Keep in mind that this is my screen magnified about 10 times.

As you can see, the monitor does not simply display the colours right off, but there is some algorithm how to display it correctly.

To some people this gives a much clearer picture. To others it is mostly annoying, as they are able to see the different colours, in spite of the small size. This is a technology used by for example TextEdit and MS Word for Mac. Your browser may also use it.

Using System Preferences > Appearance, you can change this setting for TextEdit and Microsoft Word and many other applications. If you choose CRT, you disable the subpixel rendering in the applications.
However, these settings hardly change anything at all for Pages.

Why does Pages not allow subpixel rendering? The most convincing explanation may be that it is more difficult to implement in Pages than in other applications, as text can be transparent against a coloured background. It would be very difficult to choose how to handle transparent coloured pixels, when the background changes colour.

Besides, the number of pixels per inch increases all the time with more modern screens. In the near future, it will not matter much which technology is used to map curves to pixels.

So, what can one do, if one thinks Pages displays too blurry characters on the screen today?

Not much. One can either get used to it or buy a new screen with higher resolution or simply increase the zoom.

If you want to learn more about font rendering in Mac OS X, here is a list of facts and opinions on the subject:
And after Pages '09

Wednesday, January 30, 2008

Export folder to Word, RTF, PDF, TXT or RTFD

This AppleScript to export the content of a folder with Pages documents was kindly created by Yvan Koenig. You can find more of his scripts at his Public iDisk. If you prefer to export a selection of files, you may want to have a look at the scripts in this post, which use a Scriptlet.

To use the script below, copy it all into a new script in ScriptEditor and run. Due to blogspot's layout, you may not see all characters here, but they should be copied properly, if you highlight all the non-proportional text below.
(*
Export pages documents as Word ones in the folder where the original docs where.

Assuming that we start with:
AppleScript & Office.pages
it will be exported as:
AppleScript & Office.doc
If a file already exist with the short name
it may be saved as:
AppleScript & Office#20080128T221639.doc (if withSeconds is defined as true)
AppleScript & Office#20080128T2219.doc (if withSeconds is defined as false)

the serial number is a packed version of the date/time of the save process:

2008/01/28T22:16:39 or 2008/01/28T22:16

Thanks to Dale GILLARD who teach me the way to export without using GUI scripting.

Yvan KOENIG
28 janvier 2008
29 janvier 2008
*)

property withSeconds : false (* you may set it to true if you wish *)
property typeNum : 1 (* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *)

property newExt : ""
property newType : ""
property types : {{"doc", "SLDocumentTypeMSWord"}, {"pdf", "SLDocumentTypePDF"}, {"txt", "SLDocumentTypePlainText"}, {"rtf", "SLDocumentTypeRichText"}, {"rtfd", "SLDocumentTypeRichTextBundle"}}

tell application "Finder" to set listeFichiers to every item in (choose folder) (*
dans un bloc Finder pour avoir un titre de dialogue "localisé"
• in a Finder block to get a localized dialog title. *)
if (count of listeFichiers) = 0 then return
open listeFichiers

-- ===========

on open (sel)
repeat with elem in sel
my exploreTraite(elem as alias, "")
end repeat
end open

-- ===========

on exploreTraite(elem, ptree) (*
elem est un alias
elem is an alias *)
local elem_, cl_, typeId_
set elem_ to elem as text
tell application "System Events"
set cl_ to class of item elem_
set typeId_ to type identifier of elem
end tell
set cl_ to cl_ as Unicode text

if cl_ is "file package" then
if typeId_ is "com.apple.iwork.pages.pages" then my TraiteUnPackage(elem_, ptree)
else if cl_ is "folder" then
my ExploreUnDossier(elem_, ptree)
else
-- not for us
end if -- cl_ is …
end exploreTraite

-- ===========

on ExploreUnDossier(dossier, ptree)
local nomElement, cheminElement, c
repeat with nomElement in list folder dossier without invisibles
set cheminElement to dossier & nomElement
tell application "Finder" to set c to name of (dossier as alias)
my exploreTraite(cheminElement as alias, ptree & c & ":")
end repeat
end ExploreUnDossier

-- ===========

on TraiteUnPackage(aPackage, ptree)
local docPathAndName, oldName, docName, newExt, newType
(* aPackage always ends with a colon, we must remove it *)
set aPackage to (text 1 thru -2 of (aPackage as Unicode text)) as alias

set {newExt, newType} to types's item typeNum
tell application "Finder"
set sourceFolder to (container of aPackage) as Unicode text
set oldName to name of aPackage as Unicode text
end tell -- Finder
set docName to (text 1 thru -6 of oldName) & newExt
set docPathAndName to sourceFolder & docName

tell application "System Events"
if exists file docPathAndName then
set docName to (text 1 thru -7 of oldName) & my serialize() & "." & newExt
set docPathAndName to sourceFolder & docName
end if
end tell -- system events

tell application "Pages"
open aPackage
save front document as newType in docPathAndName
close front document
end tell -- Pages
end TraiteUnPackage

-- =============

on serialize()
local cd, serial
set cd to current date
set serial to (year of cd as text) & text -2 thru -1 of ("0" & (month of cd as number)) & text -2 thru -1 of ("0" & day of cd) & "T" & text -2 thru -1 of ("0" & hours of cd) & text -2 thru -1 of ("0" & minutes of cd)
if withSeconds then
return "#" & serial & text -2 thru -1 of ("0" & seconds of cd)
else
return "#" & serial
end if
end serialize

Monday, January 28, 2008

How do I best organise my fonts in Fontbook?

You may have read in some obscure blog posting that it is good to organise your fonts in Collections in Fontbook. That obscure posting was right, but what strategy should you use to create collections? Which criteria should you use?

You should of course create one or a few folders with your favourite fonts, based entirely on what you like.

In addition, it may be good to create folders based on some objective criteria, and to do so, you can often use the search field.

You can for example start with a search for fonts that contain Italic typefaces.

1. Create a collection called "Italics".
2. Type "Italic" in the search field. The font list now only contains fonts which match the word Italic.

3. Select all fonts with command-A.

4. Clear the search field. The selection now extends to all typefaces in the fonts that contain italics.

5. Drag the selection to the collection "Italics".

You now have a collection with fonts that you can italicize ready to be used in Pages or TextEdit or any other application using the Font Palette.

But you can go on.

6. Create another collection called "Italics Slimbach".
7. Click on the Italics collection and type "slimbach" in the search field and repeat the steps above.

You now have a selection with fonts by the designer Robert Slimbach, which all contain Italic typefaces.

And on again.

8. Go through the steps above again, but this time use the search word "Russian".

And you have a collection of Slimbach's fonts that can be used in Russian with Italics.

You can go on like this and create collections with more and more detailed criteria in different areas. You can for example search for "Apple" or "Adobe" to find fonts from those companies. Or you can search for OpenType or Postscript.

There are, however, two things that seem impossible to search for reliably: non-proportional fonts and sans serif fonts.

If you need that you need to create the collections manually. But there are still quite a lot of different kinds of collections you can create using the search function.

Sunday, January 27, 2008

How do I create an index in Pages?

If you want an index of keywords in Pages, you have to create it manually. Contrary to the table of contents functionality, there is no automatic solution for indexes.

People have different strategies to create them, usually based on the search function. You can for example get a list of all pages containing a particular word using View > Show Search.

Saturday, January 26, 2008

How do I use Quartz Composer?

Uh? Isn't that a development graphics tool? What does that have to do with Pages?

Admittedly not very much, but for some situations you may want to use Quartz Composer to modify pictures or text you have converted to an image. There are better and easier tools out there, but none is cheaper than Quartz Composer as it comes with the OS. If you want to experiment with it, here is some advice to get you going:
  1. Install the Development Tools from your Mac OS X installation DVD, unless you already have them.
  2. Go to Developer > Applications, and open Quartz Composer.
  3. Create a new file from the template "Image Filter". (The main differences between this one and a blank file is the fact that the a flag in Editor > Edit Protocol Performance already is set to "Image Filter", which makes sure you get all required patches.)
  4. Remove the optional elements and the macro called "Process the Image".
  5. Go to Editor > Show Patch Parameters.
  6. Double-click on the image, and choose the image you want to use yourself.
  7. Click on Edit > Show Patch Creator.
  8. Choose any patch you fancy, for example Image Transform. (Others, like Twirl, also work.)
  9. Click on the Output node on the patch "Image (required) _protocolInput_Image" and drag it to the left Image node of "Image Transform", so you get a yellow line that links the two.
  10. Click on the node "Transformed Image" from Image Transform and drag it to the Input node of the patch "Image (required) _protocolOutput_Image".
  11. (Optional) You can also add a Filter like "Circular Wrap Distortion" before the Image Transform. The method is the same as when you added the patch in step 8. You just have to connect the nodes.
  12. Unless the Viewer is already visible, go to Window > Show Viewer.
  13. Unless it is already running, click on the Run button.
  14. Click on the patch Image Transform and change its parameters.
  15. Experiment. Change or add other patches, to see the changes.
  16. If you find a result you like, save the file.
  17. Drag the file you created to an open Pages document, where it will appear as an image - or actually a movie - in case you added any moving elements.

How do I create Word Art with Pages?

You cannot.

If you want to let the letters dance over the page following curves or shapes, you have to go beyond Pages.

A few other products that support wordart like features are Art Text and Comic Life, but there are more ones out there. You can check Version tracker for more alternatives.

Tuesday, January 22, 2008

How do I add keyboard shortcuts?

To see Pages' keyboard shortcuts, you can go to the Help menu > Keyboard Shortcuts.

Just like in any other Mac OS application, you can also see at the end of each menu command, if there is shortcut for it.



To add your own shortcuts to menu items follow these steps
  1. Go to System Preferences > Keyboard & Mouse > Keyboard Shortcuts.
  2. Click on the + symbol.
  3. Select Pages from the Application list. The first time you will have to select the last value, "Other...", to add Pages to the list, as the list by default only contains applications directly in the Applications folder. Applications in sub-folders have to be added manually.
  4. Type the exact name of a menu command, for example "Export..."
  5. Press a keyboard combination including shift (⇧), control (⌃), alt (⌥) and/or command (⌘) and one other key, for example ⌃⌥⇧⌘E.
  6. Click "Add".



From now on Pages accepts ⌃⌥⇧⌘E as a shortcut to bring up the Export window, which you can see by pulling down the menu again.



There are some things to think about here. You can basically only assign shortcuts to menus. You can for example not add shortcuts to items in the inspector. Even though you can write "macros" for Pages using AppleScript, there is no way to assign shortcuts to the macros, as they reside in the Finder. However, you can assign "hotkeys" to Styles by clicking on the triangle next to the name in the Styles Drawer.

If there are several menu items with the same name, only one of them will get the shortcut.

If you change language in System Preferences, the shortcut will no longer work.

How do I attach a Pages document to an email?

In Pages '08 and earlier, each Pages document was a folder packages, something that confused a lot of mail programs.

In Pages '09, the files are just standard files by default. (You can change the default behaviour to packages in the preferences.) One easy way to mail files is to use the "Share" menu. Here you can send the front document using Mail.app in different formats.


If you want to mail a package, you can do that too:

1. Control-click or right-click on the file in Finder.


2. Choose "Compress ...." from the pop up menu.
3. You will get an "archive", a compressed zip-file, which you can attach to your mail, just like any other file.


The recipient will download the attachment, double click on it, and the original iWork file will be ready to be opened by Pages, Numbers or Keynote.

Sunday, January 20, 2008

How do I change the default zoom?

New documents always come up with the same zoom value (the percentage in the lower left corner of the document window). Sometimes that is far too big or far too small, so you may want to change it.

The simplest and safest way is to go to the menu Pages > Preferences, and change the Default Zoom value.

However, you may want to change it to a value that is not in the preferences dialogue, let's say 99%, for the sake of argument.

If you want to change the zoom for the current document only, you can use an AppleScript:

tell window 1 of application "Pages"
set view scale to 99
end tell

If you want to change the default value for all new documents, and you are willing to take a certain risk, you can manually edit the file ~/Library/Preferences/com.apple.iWork.Pages.plist and set the parameter SLDefaultsPageScale to 0.9900000 (for 99%).

In Mac OS X before 10.7, you can also run the following command in the terminal. (Copy the entire line until 0.99 - not only what is visible. Blogspots HTML hides the end of the line.)
defaults write com.apple.iWork.Pages SLDefaultsPageScale 0.99

Friday, January 18, 2008

How do I add line numbers?

Pages does not have any easy switch to show or hide sequential numbers for each row.

You can switch on paragraph numbering in the Inspector > Text > List, but as soon as a paragraph goes over several lines, it will be out of sync.

Apple suggests that you create a numbered text box and put it on the master slide.



However, that kind of list will not work if you change the font size, like for a title, or if you insert an image that spans the full page width and disrupts the numbering.

Wednesday, January 16, 2008

Spelling does not work. What can I do?

There are a couple of things to try:
  • Highlight all text and verify in the Inspector > Text > More, that a language is chosen.
  • "Clean up" the document by exporting it to some other format (MS Word or old Pages formats for example), and import it again.
  • Go to Applications > Utilities and run Disk Utility. Go to First Aid > Repair Disk Permissions. (It actually has worked for people with this problem.)
  • You may have an old version of CocoAspell. Update to a newer version, and the problem may go away. (If you do not even have it installed, do not bother upgrading, of course.)
  • Check username/Library/Services. If you see a file called "Spell Catcher Services.service", delete it, log out, and log back in.
  • Check username/Library/Services. If you see a file called "aspell.service", delete it, log out, and log back in.
  • Remove files from username/Library/Spelling
  • Check Username/Library/Application Support. If you have a folder there called "Spell Catcher", remove it.
  • Go to /Library/Caches and trash all files ending with .csstore, and then reboot.

How do I compress images in Pages?

You cannot.

Any image you import to Pages stays its original quality and size to allow print outs and exported PDF files to be as good as possible.

If you really want to save space, you have to compress the original image file in an external graphics editor, like iPhoto, Photoshop, Aperture, the gimp, or many others. This is not the place to evaluate which one is best, but there is a list of some possible ones at Wikipedia.

Even though you cannot compress the images within Pages, note that for the finished document, you can export a compressed PDF version from Pages using Share > Export. (Before Pages '09, the menu was File > Export.)

Sunday, January 13, 2008

Where did all those tabs come from?

When you open a Pages document, it has no visible tabulator stops at all.

However, there is a hidden set of default tab stops, just like in Open Office, Microsoft Word and many other word processors.

As soon as you add a manual tab stop to a paragraph, all previous default tabs disappear:


The distance between the hidden default tabs is defined in the inspector.



However, sometimes a paragraph suddenly gets plenty of visible tabs:

This can happen if you paste text from applications like TextEdit or AppleWorks. These applications do not have the concept of hidden default tabs, so they have to use real visible tabs instead.

The easiest way to get rid of them is to apply a paragraph style without tabs. You can often simply click on the red triangle to the right of the style name and choose "Revert to Defined Style".

Why can't I add Reflections or Adjust an Image?

The text below was written before Pages '09. With Pages '09, you can add reflections to shapes, but the other restrictions remain.

...

If you highlight an object and go to the Inspector > Graphic, it is possible that the Reflections checkbox is greyed out. And if you go to View > Show Adjust Image, it is possible that none of the controls work.

This may be because you
a) have not highlighted anything. (Make sure you clicked on the image.)
b) have highlighted something that is not an image. Images can for example be PNG, JPEG, GIF, TIFF with or without layers and transparency in CMYK, LAB or RGB colour space.

You cannot add reflections to inserted shapes (Insert > Shape > whatever), tables, text or charts, even though you can add shadows and change transparency for them. Neither can you use the Adjust Image window with them.

Reflections work only on images and PDF files you have inserted from elsewhere (for example with Insert > Choose... or drag-and-drop from the Finder).

Adjust Image only works on images but not on inserted PDF files.

Why does Pages have these limitations? It is because PDF files and inserted shapes are vector graphics. They have a completely different way of handling colours. Take for example the slider for "Sharpness". To apply sharpness to bitmap graphics, you simply change the surrounding pixels a little. However, for vector graphics, there is nothing called "surrounding pixels", to that kind of adjustment does not work.

The main problem here is not that Pages does not apply adjustments to vector graphics. The main problem is that it does not provide any user feedback why it cannot be done, and what the user can do to get around the problem.


In this image the left circle is a shape from Insert > Shape > Oval, so it does not accept reflections. The right circle is an image that was dragged onto the document from the Finder, so the reflection works fine.