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 7, 2006 2:31 PM in response to Mikeaaa

Well, I was not satisfied with the "solution" I brought, so I wrote another applescript that could match your needs ! You still should, however, place it in your script menu and assign a shortcut to it via a third party app. The script :

tell application "Pages" to activate
tell application "System Events" to tell process "Pages"
tell menu bar 1
-- In the following 2 lines I'm not sure of the name of the menu and of the menu item, as I don't use the app in english
tell menu 1 of menu bar item "Insertion"
click menu item "date & time…"
end tell
end tell
-- In the following line, replace the french text with the exact text you read beside the check box in the date and time panel (it's name, in fact), it should be something like "Update automatically the date and time when the document is open". I'm not sure : I'm not using the app in english. If it's 2 line long, just write in the script the exacts words of the FIRST line only (you can see that the french sentence is not complete : the words of the second line have to be omitted, don't know why)
click checkbox "Mettre automatiquement à jour la date et l’heure quand le" of sheet 1 of window 1
end tell
tell application "System Events" to tell process "Pages"
-- The following line emulate the down arrow key : repeat this line as much time as you would hit the dow arrow key to highlight the right item in the window
key code 123
keystroke return
end tell

Franck

Powerbook G4 12" 1 Ghz ; iMac G3 400 Mhz Mac OS X (10.4.5)

Apr 7, 2006 2:32 PM in response to Mikeaaa

Well, I was not satisfied with the "solution" I brought, so I wrote another applescript that could match your needs ! You still should, however, place it in your script menu and assign a shortcut to it via a third party app. The script :

tell application "Pages" to activate
tell application "System Events" to tell process "Pages"
tell menu bar 1
-- In the following 2 lines I'm not sure of the name of the menu and of the menu item, as I don't use the app in english
tell menu 1 of menu bar item "Insertion"
click menu item "date & time…"
end tell
end tell
-- In the following line, replace the french text with the exact text you read beside the check box in the date and time panel (it's name, in fact), it should be something like "Update automatically the date and time when the document is open". I'm not sure : I'm not using the app in english. If it's 2 line long, just write in the script the exacts words of the FIRST line only (you can see that the french sentence is not complete : the words of the second line have to be omitted, don't know why)
click checkbox "Mettre automatiquement à jour la date et l’heure quand le" of sheet 1 of window 1
end tell
tell application "System Events" to tell process "Pages"
-- The following line emulate the down arrow key : repeat this line as much time as you would hit the dow arrow key to highlight the right item in the window
key code 123
keystroke return
end tell

Franck

Apr 10, 2006 9:59 AM in response to Mikeaaa

I am not using Tiger yet, so please forgive my ignorance:

Automator actions... can they work for apps like Pages or are they restricted to the Finder?

I miss Applework's (OS 9 only) macros. You can record many tedious sequences and turn them into a one-click button on the toolbar. Not every action is recordable but I have turned several pain-in-the-neck sequences into one click buttons. If Automator cannot do this it should. Applescript, with its high level geekery, is not an option for most users. In the world of advanced GUI there should be less code learning.

Kurt

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.