I’m creating a macro
to automatically open a word 2011 personal template.
I get an error when i try to choose the template.
The the actions sequence is the following:
type the shift+command+P Keystroke to create a
new document from a template: ok
type the tab keystroke two times to activate the
template choice: ok
type the up arrow keystroke to reach the
personal template section: ok
type the tab keystroke to enter the right side
of the personal tempalte section where are my templates: ok
at this point i should add the action “type
the right arrow keystroke” to reach the second personal template but the action
does not work and i get a beep error (as if I had pressed a key not enabled in
that section of Word)
i recently upgraded to Mavericks my computer and since i have done this the script doesn’t work: have you any idea how to fix the problem? the template is not found and remains the initial blank sheet.
If you moved the template to a folder you have to account for that. Rename Normal.dotm as needed.
set templateName to "Normal.dotm"
tell application "Microsoft Word"
set userTemplatesFldr to get default file path file path type user templates path
set myTemplate to userTemplatesFldr & ":" & templateName
open file myTemplate
If you’re still having problems get the path of your template on disk, and compare it to the value of the myTemplate variable.
This is a super simple script, so it should just work.
You can sometimes get errors when executing scripts in Keyboard Maestro if you have one or more variables that are very large or contain binary characters (eg you read an image file or pdf into a variable). The reason for this is that Keyboard Maestro places your variables into environment variables before executing script (including AppleScripts), and it is possible for large or binary values in the environment to cause the system to choke.
So check your variables (Keyboard Maestro ➤ Preferences, Variables pane) and see if any are large or weird.