Std DlgMacroExecute: Difference between revisions

From FreeCAD Documentation
(Removed 'In progress'.)
(Docnav)
(35 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<translate>
<translate>


<!--T:7-->
{{Docnav
{{Docnav
|[[Std_DlgMacroRecord|DlgMacroRecord]]
|[[Std_MacroStopRecord|Std MacroStopRecord]]
|[[Std_DlgMacroExecuteDirect|Std DlgMacroExecuteDirect]]
|[[Std_DlgMacroExecuteDirect|DlgMacroExecuteDirect]]
|[[Std_Macro_Menu|Std Macro Menu]]
|[[Std_Macro_Menu|Std Macro Menu]]
|IconL=Std_MacroStopRecord.svg
|IconL=Std_DlgMacroRecord.svg
|IconR=Std_DlgMacroExecuteDirect.svg
|IconR=Std_DlgMacroExecuteDirect.svg
|IconC=Freecad.svg
|IconC=Freecad.svg
Line 25: Line 26:


</translate>
</translate>
[[Image:Std_DlgMacroExecute_dialog.png]]
[[Image:Std_DlgMacroExecute_dialog.png|300px]]
<translate>
<translate>
<!--T:8-->
{{Caption|The Execute macro dialog box}}
{{Caption|The Execute macro dialog box}}


Line 35: Line 37:
#* Press the {{Button|[[Image:Std_DlgMacroExecute.svg|16px]] [[Std_DlgMacroExecute|Std DlgMacroExecute]]}} button.
#* Press the {{Button|[[Image:Std_DlgMacroExecute.svg|16px]] [[Std_DlgMacroExecute|Std DlgMacroExecute]]}} button.
#* Select the {{MenuCommand|Macro → [[Image:Std_DlgMacroExecute.svg|16px]] Macros...}} option from the menu.
#* Select the {{MenuCommand|Macro → [[Image:Std_DlgMacroExecute.svg|16px]] Macros...}} option from the menu.
# The Execute macro dialog box opens. See [[#Options|Options]].
# The '''Execute macro''' dialog box opens. See [[#Options|Options]].


==Options==
==Options== <!--T:9-->


===Find file / Find in files=== <!--T:40-->
===User macros===


<!--T:41-->
# The '''User macros''' tab lists the macros available in the '''User macros location'''.
: {{Version|0.22}}
# Click a macro to select it.

<!--T:42-->
: These two input boxes can be used to filter macros from the file list on the '''User macros''' tab or the '''System macros''' tab. You may use regular expressions or simply enter text. All matches are case-insensitive.

<!--T:43-->
: '''Find file''' filters the list by filename. Only filenames that match the entered text will appear in the list. '''Find in files''' filters the list by file content. Only files whose text content matches the entered text will appear in the list.

<!--T:44-->
: Remove all text from a filter's input box to disable it. If both input boxes contain text, both filters are applied. Filtering may result in an empty list.

===User macros=== <!--T:10-->

<!--T:45-->
: The '''User macros''' tab lists the macros available in the '''User macros location'''.

<!--T:11-->
# Click a macro in the list to select it.
# The name of the selected macro will appear in the '''Macro name''' box.
# The name of the selected macro will appear in the '''Macro name''' box.


===System macros===
===System macros=== <!--T:12-->


<!--T:46-->
: The '''System macros''' tab is not used at this time.
: To make use of the '''System macros''' tab you must create a folder named {{FileName|Macro}} as a sibling folder of the {{FileName|bin}} folder where FreeCAD is installed and put some macros there.

<!--T:47-->
: To find the {{FileName|bin}} folder enter this in the [[Python_console|Python console]]:

</translate>
: {{Code|code=
App.getHomePath()
}}
<translate>

<!--T:48-->
# Click a macro in the list to select it.
# The name of the selected macro will appear in the '''Macro name''' box.


===User macros location===
===User macros location=== <!--T:14-->


<!--T:15-->
# Press the {{Button|...}} button to change the user macros location.
# Press the {{Button|...}} button to change the user macros location.
# Browse to a different folder and select it.
# Browse to a different folder and select it.


===Execute===
===Execute=== <!--T:16-->


<!--T:17-->
# To execute a macro do one of the following:
# To execute a macro do one of the following:
#* Select the macro in the list and press the {{Button|Execute}} button.
#* Select the macro in the list and press the {{Button|Execute}} button.
Line 62: Line 97:
# The macro is executed.
# The macro is executed.


===Close===
===Close=== <!--T:18-->


<!--T:19-->
# Press {{KEY|Esc}} or the {{Button|Close}} button to close the dialog box.
# Press {{KEY|Esc}} or the {{Button|Close}} button to close the dialog box.


===Create===
===Create=== <!--T:20-->


<!--T:21-->
# Press the {{Button|Create}} button to create a new macro file.
# Press the {{Button|Create}} button to create a new macro file.
# Enter a name in the dialog box that pops up. You do not have to include the {{FileName|.FCMacro}} extension.
# Enter a name in the dialog box that pops up. You do not have to include the {{FileName|.FCMacro}} extension.
Line 74: Line 111:
# The new file is opened in the Macro editor.
# The new file is opened in the Macro editor.


===Delete===
===Delete=== <!--T:22-->


<!--T:23-->
# Select the macro you want to delete in the list.
# Select the macro you want to delete in the list.
# Press the {{Button|Delete}} button.
# Press the {{Button|Delete}} button.
# Press the {{Button|Yes}} button in the confirmation dialog box that pops up.
# Press the {{Button|Yes}} button in the confirmation dialog box that pops up.


===Edit===
===Edit=== <!--T:24-->


<!--T:25-->
# Select the macro you want to edit in the list.
# Select the macro you want to edit in the list.
# Press the {{Button|Edit}} button.
# Press the {{Button|Edit}} button.
Line 87: Line 126:
# The selected file is opened in the Macro editor.
# The selected file is opened in the Macro editor.


===Rename===
===Rename=== <!--T:26-->


<!--T:27-->
# Select the macro you want to rename in the list.
# Select the macro you want to rename in the list.
# Press the {{Button|Rename}} button.
# Press the {{Button|Rename}} button.
Line 94: Line 134:
# Press {{KEY|Enter}} or the {{Button|OK}} button.
# Press {{KEY|Enter}} or the {{Button|OK}} button.


===Duplicate===
===Duplicate=== <!--T:28-->


<!--T:29-->
# Select the macro you want to duplicate in the list.
# Select the macro you want to duplicate in the list.
# Press the {{Button|Duplicate}} button.
# Press the {{Button|Duplicate}} button.
Line 101: Line 142:
# Press {{KEY|Enter}} or the {{Button|OK}} button.
# Press {{KEY|Enter}} or the {{Button|OK}} button.


===Toolbar===
===Toolbar=== <!--T:30-->


<!--T:31-->
# Select the macro you want to add to a custom toolbar in the list.
# Select the macro you want to add to a custom toolbar in the list.
# Press the {{Button|Toolbar}} button.
# Press the {{Button|Toolbar}} button.
# Two 'walkthrough' dialogs will guide you through the required steps. See [[Interface_Customization|Interface Customization]] for more information.
# Two 'walkthrough' dialogs will guide you through the required steps. See [[Interface_Customization|Interface Customization]] for more information.


===Addons===
===Download=== <!--T:39-->


<!--T:33-->
# Press the {{Button|Addons...}} button to start the [[Addon_manager|Addon manager]].
# Press the {{Button|Download}} button to start the [[Std_AddonMgr|Addon manager]].


==Notes==
==Notes== <!--T:34-->


<!--T:35-->
* To learn more about macros see the [[Macros]] page.
* To learn more about macros see the [[Macros]] page.


==Preferences==
==Preferences== <!--T:36-->

<!--T:37-->
* The user macros location can also be changed in the preferences: {{MenuCommand|Edit → Preferences... → Python → Macro → Macro path}}. See [[Preferences_Editor#Macro|Preferences Editor]].


* The user macros location can also be changed in the preferences: {{MenuCommand|Edit → Preferences... → General → Macro → Macro path}}. See [[Preferences_Editor#Macro|Preferences Editor]].


<!--T:38-->
{{Docnav
{{Docnav
|[[Std_DlgMacroRecord|DlgMacroRecord]]
|[[Std_MacroStopRecord|Std MacroStopRecord]]
|[[Std_DlgMacroExecuteDirect|Std DlgMacroExecuteDirect]]
|[[Std_DlgMacroExecuteDirect|DlgMacroExecuteDirect]]
|[[Std_Macro_Menu|Std Macro Menu]]
|[[Std_Macro_Menu|Std Macro Menu]]
|IconL=Std_MacroStopRecord.svg
|IconL=Std_DlgMacroRecord.svg
|IconR=Std_DlgMacroExecuteDirect.svg
|IconR=Std_DlgMacroExecuteDirect.svg
|IconC=Freecad.svg
|IconC=Freecad.svg
Line 131: Line 178:
{{Std Base navi{{#translation:}}}}
{{Std Base navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 08:02, 10 October 2023

Std DlgMacroExecute

Menu location
Macro → Macros...
Workbenches
All
Default shortcut
None
Introduced in version
-
See also
Std DlgMacroExecuteDirect

Description

The Std DlgMacroExecute command opens the Execute macro dialog box. From this dialog box macros can be executed, edited and managed.

The Execute macro dialog box

Usage

  1. There are several ways to invoke the command:
  2. The Execute macro dialog box opens. See Options.

Options

Find file / Find in files

introduced in version 0.22
These two input boxes can be used to filter macros from the file list on the User macros tab or the System macros tab. You may use regular expressions or simply enter text. All matches are case-insensitive.
Find file filters the list by filename. Only filenames that match the entered text will appear in the list. Find in files filters the list by file content. Only files whose text content matches the entered text will appear in the list.
Remove all text from a filter's input box to disable it. If both input boxes contain text, both filters are applied. Filtering may result in an empty list.

User macros

The User macros tab lists the macros available in the User macros location.
  1. Click a macro in the list to select it.
  2. The name of the selected macro will appear in the Macro name box.

System macros

To make use of the System macros tab you must create a folder named Macro as a sibling folder of the bin folder where FreeCAD is installed and put some macros there.
To find the bin folder enter this in the Python console:
App.getHomePath()
  1. Click a macro in the list to select it.
  2. The name of the selected macro will appear in the Macro name box.

User macros location

  1. Press the ... button to change the user macros location.
  2. Browse to a different folder and select it.

Execute

  1. To execute a macro do one of the following:
    • Select the macro in the list and press the Execute button.
    • Double-click the macro in the list.
  2. The dialog box closes.
  3. The macro is executed.

Close

  1. Press Esc or the Close button to close the dialog box.

Create

  1. Press the Create button to create a new macro file.
  2. Enter a name in the dialog box that pops up. You do not have to include the .FCMacro extension.
  3. Press Enter or the OK button.
  4. Both dialog boxes close.
  5. The new file is opened in the Macro editor.

Delete

  1. Select the macro you want to delete in the list.
  2. Press the Delete button.
  3. Press the Yes button in the confirmation dialog box that pops up.

Edit

  1. Select the macro you want to edit in the list.
  2. Press the Edit button.
  3. The dialog box closes.
  4. The selected file is opened in the Macro editor.

Rename

  1. Select the macro you want to rename in the list.
  2. Press the Rename button.
  3. Enter a new name in the dialog box that pops up. You do not have to include the .FCMacro extension.
  4. Press Enter or the OK button.

Duplicate

  1. Select the macro you want to duplicate in the list.
  2. Press the Duplicate button.
  3. Enter a new name in the dialog box that pops up. You do not have to include the .FCMacro extension.
  4. Press Enter or the OK button.

Toolbar

  1. Select the macro you want to add to a custom toolbar in the list.
  2. Press the Toolbar button.
  3. Two 'walkthrough' dialogs will guide you through the required steps. See Interface Customization for more information.

Download

  1. Press the Download button to start the Addon manager.

Notes

  • To learn more about macros see the Macros page.

Preferences

  • The user macros location can also be changed in the preferences: Edit → Preferences... → Python → Macro → Macro path. See Preferences Editor.