How do I modify a keyboard Maestro macro for Microsoft Word to work in Pages using AppleScript?
I am trying to modify a keyboard Maestro macro I use in Microsoft word to work in Pages. It goes through a document looking for certain variables and replacing with what I enter in a form. Here is how it is written for Word. It is an apple script.
tell application "System Events" to tell process "Word"
click menu item "Select All" of menu 1 of menu bar item "Edit" of menu bar 1
end tell
tell application "Microsoft Word"
set myFind to find object of selection
tell myFind
execute find find text "?Title" replace with theTitle replace replace all
execute find find text "?Series" replace with theSeries replace replace all
execute find find text "?sdat" replace with theDate replace replace all
end tell
-- replace footer as well
set findObject to (find object of text object of (get footer of section 1 of document 1 index header footer primary))
tell findObject
execute find find text "?Title" replace with theTitle replace replace all
end tell
end tell
I can't figure out how to get an auto selecting of the document in Pages. Any help or ideas appreciated.
macmikeal (at) Mac (dot) com
I tried to replace the menu 1 information with command an and it would take that.
[Re-Titled by Moderator]
Mac mini