summaryrefslogtreecommitdiff
path: root/testautomation/global/tools/includes/optional/t_macro_tools.inc
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/global/tools/includes/optional/t_macro_tools.inc')
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_macro_tools.inc40
1 files changed, 40 insertions, 0 deletions
diff --git a/testautomation/global/tools/includes/optional/t_macro_tools.inc b/testautomation/global/tools/includes/optional/t_macro_tools.inc
index 6c1fcc478e5a..733b28fa32f4 100755..100644
--- a/testautomation/global/tools/includes/optional/t_macro_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_macro_tools.inc
@@ -172,4 +172,44 @@ function hBasicIDERunMacro( cIdentifier as string ) as boolean
hBasicIDERunMacro() = false
endif
+end function
+
+'*******************************************************************************
+
+function hExecMacro( cMacro as string ) as boolean
+
+ const CFN = "global::tools::includes::optional::t_macro_tools.inc::hExecMacro(): "
+
+ dim iCurrentModule as integer
+ dim iCurrentMacro as integer
+ hEXECMacro() = FALSE
+
+ ToolsMacro_uno
+
+ kontext "Makro"
+ if ( Makro.exists( 2 ) ) then
+ ' Iterate through the left treelist
+ for iCurrentModule = hExpandAllNodes( MakroAus ) to 1 step -1
+ MakroAus.select( iCurrentModule )
+ ' Iterate through the Macros list (right pane)
+ for iCurrentMacro = 1 to MakroListe.getItemCount()
+ MakroListe.select( iCurrentMacro )
+ ' Try to find the macro
+ if ( cMacro = MakroListe.getSelText() ) then
+ ' Run the macro
+ if ( Ausfuehren.isEnabled() ) then
+ Ausfuehren.click()
+ hExecMacro() = TRUE
+ exit function
+ else
+ warnlog( CFN & "Macro found but <Ausfuehren> is not enabled" )
+ exit function
+ endif
+ endif
+ next iCurrentMacro
+ next iCurrentModule
+ else
+ warnlog( CFN & "Macro Organizer is not open within 2 seconds" )
+ endif
+
end function \ No newline at end of file