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.