Automating Word - for a personal Journal

E

ecarter9

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I have a journal i keep. I would like to automate a sequence.
Go to bottom of page
Hit Return
Highlight and Bold
Enter Date
Enter Time
Enter blank line
No High light and Bold

I have not clue if this is something I can do with Automator or a Macro. I have tried to figure this one out. Can anyone help?
 
J

John McGhie

You could do this with AppleScript, not with Automator.

But you're doing things the hard way!

But why not simply use a Style? Set the formatting of Heading 1 style the
way you like it, and set its "Style for following paragraph" to be Normal.

Then for example: Hit Command + End (end of Document)

Then Command + Option + 1 (Apply Heading 1).

You've done the job in two keystrokes.

The key is to start using styles to do your formatting, because you only
have to set the format once. After setting the format for a style, check
the box you will see in Format Style named "Add to Template", then you have
got it for the rest of your life.

Look up "Styles" in the help. When you get a bit more adventurous, look up
"AutoText". AutoText enables you to store pre-styled blocks of text that
you can insert with a single keystroke.

Cheers

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel
I have a journal i keep. I would like to automate a sequence.
Go to bottom of page
Hit Return
Highlight and Bold
Enter Date
Enter Time
Enter blank line
No High light and Bold

I have not clue if this is something I can do with Automator or a Macro. I
have tried to figure this one out. Can anyone help?

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
E

ecarter9

I have not had a chance to look up styles and autotext. That may work.
Will either of these insert the date, then insert the time? I am trying to automate with minimal keystrokes, adding date, adding time, highlight, bold, add a line and start a paragraph.
 
J

John McGhie

Well, AutoText will enable you to include a DATE field and a TIME field in
the text you save. But if you have more than one in the document, they will
all update to the same date and time, which is not what you want.

Instead, User Insert>Date and Time, and do NOT check "Update Automatically".

I have assigned that to a keystroke (Control + d). Each time the dialog
opens, the format you used last will be selected: I use only one format.

So now we're up to three keystrokes :) Still quicker than creating and
running an AppleScript :)

In the next version of Word, you will have VBA back, and be able to do
exactly what you want.

Cheers


I have not had a chance to look up styles and autotext. That may work.
Will either of these insert the date, then insert the time? I am trying to
automate with minimal keystrokes, adding date, adding time, highlight, bold,
add a line and start a paragraph.

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
U

u2bredbkwhen

ecarter,

I do much the same thing with my daily journal and much of the tedium can be automated.

The Applescript I use is pasted below:

-- I find it easier to assign a path to a variable to minimize typing
-- it also makes it easier to maintain the script
set DefaultLocation to "macintosh hd:users:shared:eek:ffice documents:..."

tell application "Microsoft Word"
        activate
         
        set myFile to choose file with prompt "Please choose a file to open" default location DefaultLocation as alias
        open myFile
         
        -- the assumption is that the bookmark is at the end of the document
        select bookmark "beginhere" of active document
         
        tell selection
                collapse range text object of selection direction collapse end
                type paragraph
                collapse range text object of selection direction collapse end
                 
                set style of text object to style header
                -- I use a 12-hour clock. The script for a 24-hour clock should be similar
                insert date time at text object of selection ¬
                        date time format "DDDD, dd MMM yyyy (hh:mm am/pm)" without insert as field
                -- end if
        end tell
         
        select text object of last paragraph of the active document
        tell selection
                collapse range text object of selection direction collapse end
                type paragraph
                collapse range text object of selection direction collapse end
                -- insert bookmark BeginHere at text object of selection
                make new bookmark at text object of selection of active document with properties {name:"BeginHere", text object:text object of cursor}
        end tell

end tell

Hope this helps

u2b
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top