Button label (@button)
The // @button directive defines the label of the confirm button in the parameter dialog. The default is "Insert" — for Actions or scripts that do something instead of inserting, "Run", "Apply" or similar often fits better.
Syntax
// @button <label>
- A comment line in the script header, like
@paramand@help. - The label may contain spaces (the rest of the line is used).
- Without
@buttonthe button keeps the default "Insert".
Where the text appears
The text appears on the OK button of the parameter dialog shown when inserting/running a parameterized snippet or an Action. When saving an Action, the same value is also stored as its button label.
Example
An Action that writes a text into every text box on the active slide — with one parameter and a matching button label:
// @button Apply
// @param string NewText "Text" default="Hello world" tooltip="Written into all text boxes"
foreach (Shape sh in oSlide.Shapes)
{
if (sh.HasTextFrame == MsoTriState.msoTrue &&
sh.TextFrame.HasText == MsoTriState.msoTrue)
{
sh.TextFrame.TextRange.Text = Params.GetString("NewText");
}
}
When run, the parameter dialog appears with the field "Text" — and the confirm button is labelled "Apply" instead of "Insert".
Useful values
| Value | When |
|---|---|
Insert |
Default (snippet creates an object) |
Run |
Action / script that performs a function |
Apply |
Change to existing objects |
Create |
Create several objects / a structure |
Export |
Output data/file |