Microsoft Word Suite
245
Example
This example removes the CTRL+SHIFT+B key assignment. This key combination is assigned to the
Bold command by default.
set customization context to normal template
disable (find key key code (build key code key1 control_key key2 shift_key ¬
key3
b_key))
This example assigns the CTRL+SHIFT+O key combination to the Organizer command. The
example then uses the disable command to remove the CTRL+SHIFT+O key combination and then
displays a message.
set customization context to normal template
make new key binding with properties {key code:(build key code key1 ¬
control_key key2 shift_key key3 o_key), key category:key ¬
category
command,
command:"Organizer"}
display dialog (get command of (find key key code (build key code key1 ¬
control_key key2 shift_key key3 o_key))) & " is assigned to ¬
CTRL+SHIFT+O"
disable (find key key code (build key code key1 control_key key2 shift_key ¬
key3
o_key))
if command of (find key key code (build key code key1 control_key ¬
key2 shift_key key3 o_key)) is "" then display dialog "Nothing is ¬
assigned
to
CTRL+SHIFT+O"
This example removes all key assignments for the global macro named "Macro1."
set customization context to normal template
repeat with aKey in (get keys bound to key category key category macro ¬
command
"Macro1")
disable aKey
end repeat
Command: display Word dialog
Displays the specified built-in Word dialog box until either the user closes it or the specified amount
of time has passed. Returns an integer that indicates which button was clicked to close the dialog
box.
Return value
Description
-2 The
Close button.
-1 The
OK button.
0 (zero)
The Cancel button.
> 0 (zero)
A command button: 1 is the first button, 2 is the second button, and so on.