Macros for Pages??

I'm new to Mac. I need to create a "macro" for use in pages that will: go to the beginning of the line then count over 32 characters (and also go to the end of the line and count back 32 characters). I do this hundreds of times per document when creating closed captions. Can someone help?

MacBook Air (13-inch Mid 2013), OS X Mavericks (10.9.2)

Posted on Apr 6, 2014 12:50 PM

Reply
4 replies

Apr 6, 2014 1:19 PM in response to JulietKn

On the Mac you use AppleScripts or Automator workflows to get applications to do what you want.


Pages '09 had a very rich AppleScript library, but Apple removed nearly all of it in Pages 5.


Pages 5.2 has reintroduced more scripting, but I am uncertain as to how much, or whether there is enough for your needs.


Either way you are better off doing what you need in Pages '09 or some other fully scriptable application.


http://www.smashingmagazine.com/2009/05/22/mac-hacks-17-applescripts-to-make-you r-life-easier/


Peter

Apr 6, 2014 4:29 PM in response to JulietKn

This is pretty primitive, but it works. You can write litte applescript scriplets to do what you want. This one, e.g. moves the cursor to the beginning of the line, then moves the cursor 32 spaces to the right (key code for move right is 124, for move left is 123).


activateapplication "Pages"

tell application "System Events" to tell process "Pages"


keystroke "a" usingcontrol down

repeat 32 times


key code 124

end repeat

end tell

Apr 6, 2014 4:50 PM in response to JulietKn

Actually, that scriptlet is not right: it goes to the beginning of the *paragraph*, so if you are dealing with more than one line, it one work as expected. But this, I think. will:


activateapplication "Pages"

tell application "System Events" to tell process "Pages"


key code 123 using {command down} # go to beginning of line

repeat 32 times


key code 124 # move right 32 characters

end repeat

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.

Macros for Pages??

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