Moving from Word: How do I make a macro?

I have just bought Pages, as a replacement for Word. (I got tired of lines appearing across my text for no good reason, that I couldn't delete.) Anyway, how do I get a horizontal line across the page in Pages?
(That isn't my main question.) In Words I programmed a macro shortcut that let me click on the page and put today's date where I wanted it, without opening a couple of menus first. Is there any way of doing macros in Pages or otherwise setting up shortcuts like that? There seems to be nothing in the user's guide.

Mike

PowerBook 17-inch Mac OS X (10.4.5)

PowerBook 17-inch, Mac OS X (10.4.3)

Posted on Apr 1, 2006 11:10 AM

Reply
23 replies

Apr 2, 2006 4:06 PM in response to Mikeaaa

Hullo Mikeaaa:

Ben's advice would seem best for any but brief text-only substitutions, for which you could use the "auto correction" feature and a short-hand of your choice for the entry to be substituted.

But to put a line wherever you want it, you have two options. You can insert a shape, choosing line, from either the "Insert" menu or the "Objects" icon, then use the handles to make it horizontal and the objects inspector to set its thickness and colour - or you can use the fonts dialogue and "non-breaking spaces" to insert an underline without actual text. This will then be in a weight to suit your current font.

Make sure you have "effects" showing in your font dialogue to do this. To do this, click on the gear wheel at the bottom left of this dialogue and select "show effects." Choose underline - the first effect that will be shown, and then type option / space as many times as you need for the length of line you want. This is good, for example, for creating printed forms.

You can do the same with the strikethrough option, which will place the line at the vertical centre of normal text; and with both, you have the option of a single or double line for the purpose, and to select a colour for it by clicking on the triangle next to the option you select.

Regards.

Apr 3, 2006 3:41 AM in response to Mikeaaa

I have just bought Pages, as a replacement for Word.
(I got tired of lines appearing across my text for no
good reason, that I couldn't delete.) Anyway, how do
I get a horizontal line across the page in Pages?
(That isn't my main question.) In Words I programmed
a macro shortcut that let me click on the page and
put today's date where I wanted it, without opening a
couple of menus first. Is there any way of doing
macros in Pages or otherwise setting up shortcuts
like that? There seems to be nothing in the user's
guide.


No, there's nothing in the User Guide about AppleScript and Pages 2.

If you only want a shortcut to insert a date, then create a keyboard shortcut for the Insert > Date & Time… menu. You can do this from System Preferences. Just open the Keyboard & Mouse pane, choose the Keyboard Shortcuts tab, and click the + button at the lower left to create a keyboard shortcut.

The details you'll need to enter are:

Application: Pages.
Menu Title: Date & Time… (NB The ellipsis is created by pressing Option+;).
Keyboard Shortcut: (whatever you want that doesn't conflict with other Pages keyboard shortcuts.)

If you want to go beyond this then find out more about AppleScript. Someone has already noted that Pages doesn't directly display AppleScripts in its toolbar, etc. The way to get quick access to AppleScripts is to use the AppleScript Utility program. It can display a script menu in your menu bar so that AppleScripts are only two clicks away.

Dale

Apr 5, 2006 9:12 AM in response to Mikeaaa

I tried to follow the instructions on setting up a Keyboard shortcut: like so -
Select System preferences/ Keyboard & Mouse/ Keyboard Shortcuts tab /
Click + / Select iWork -> Pages / √ Add
Enter Date & Time… /Com-Shift-D / √Add

But what this does is to open an empty table called Chart Data Editor. What did I do wrong? I think I typed Date & Time… exactly. Mikeaaa

Apr 6, 2006 1:21 AM in response to Mikeaaa

I tried to follow the instructions on setting up a
Keyboard shortcut: like so -
Select System preferences/ Keyboard & Mouse/ Keyboard
Shortcuts tab /
Click + / Select iWork -> Pages / √ Add
Enter Date & Time… /Com-Shift-D / √Add

But what this does is to open an empty table called
Chart Data Editor. What did I do wrong? I think I
typed Date & Time… exactly.


Cmd ShiftD is the shortcut key for the Format > Chart > Hide Data Editor menu in Pages. You'll have to choose a different keyboard shortcut as it appears you can't override an existing shortcut.

Dale

Apr 7, 2006 2:50 AM in response to Mikeaaa

Command-Shift-D opened Chart Editor, but I have now
tried other key combinations and I get zilch. I
repeated the procedure but with Control-Command-D as
the key combination. This key combination now shows
up opposite Date & Time… in the Insert menu. But
when I use Control-Command-D it doesn't do anything
at all. Just sits there.


Did you type the ellipsis correctly, and not as three periods?

You also need to log out &/or restart for the keyboard shortcut to be activated. Have you done this?

Dale

Apr 7, 2006 8:51 AM in response to Bekins

Did you type the ellipsis correctly, and not as three periods?

Yes, ellipsis done properly

You also need to log out &/or restart for the keyboard shortcut to be activated. Have you done this?


I closed down and started up again since yesterday, and now Ctrl-Command-D has disappeared from the Insert menu, and nothing happens if I use it.


Cmd-Control-D is pre-defined as a global key equivalent for Look up in Dictionary. You can either un-define it for all applications, which should allow your custom key equivalent to work, or you can pick something else, like Cmd-Control-Shift-D.

I created a new keyboard shortcut with Cmd-Control-Shift-D, logged out and in, and it works! Thanks to everyone who helped. I still have to pick the right format EVERY TIME, and I still have to remember to uncheck 'Automatically Update the Date' EVERY TIME! It would be much better if I could choose defaults for these settings, or modify preferences. But that doesn't seem possible. Thanks again, Mike

Apr 7, 2006 1:25 PM in response to Mikeaaa

In Words I programmed
a macro shortcut that let me click on the page and
put today's date where I wanted it, without opening a
couple of menus first. Is there any way of doing
macros in Pages or otherwise setting up shortcuts
like that? There seems to be nothing in the user's
guide.


I wanted the same as you, and I wrote a little applescript to do so :

-- A script to insert date and time in the Pages front doc (can use it with every app, just replace "Pages" by the name of your app). It doesn't make use of Pages built-in date and/or time insertion feature, but of the system wide one. Just save the script in your ~/Library/Scripts and it will appear in the script menu, in the menu bar (if you have enable it) ; then, assign a keyboard shortcut to it, with one of the various app that can do so — I use Insanity's MenuMaster, and it works well. With this whole process, I have added to Pages a lot of keyboard shortcuts : to some characters I use often, to paragraph styles…

set the clipboard to ((current date) as string)
tell application "Pages" to activate
tell application "System Events" to tell process "Pages"
tell menu bar 1
tell menu 1 of menu bar item "Édition"
click menu item "Coller"
end tell
end tell
end tell

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Moving from Word: How do I make a macro?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.