;Runs a macro from other QM macro list file. Does not check
;whether it is actually macro. That is, gets first item that
;matches macro_name. It can be even folder.
;Two macros cannot run simultaneously. If this function is
;called from a macro, the extracted macro runs when the
;caller macro ends. If called from a function, runs
;simultaneously.
;EXAMPLE
;RunMacroFromFile("test.qml" "Macro2")
str s.GetMacroFromFile(qml_file macro_name) RunTextAsMacro s err+ end _error
;Runs executable function from other QM macro list file.
;Does not check whether it is actually function. That is,
;gets first item that matches function_name. It can be even
;folder.
;The extracted function runs asynchronously. This function
;returns thread handle. If caller wants to wait until the
;function ends, it can use the handle with the wait function.
;EXAMPLE
;wait 0 H RunFunctionFromFile("test.qml" "Function2")
str s.GetMacroFromFile(qml_file function_name) ret RunTextAsFunction(s a1 a2 a3 a4) err+ end _error
If file or macro not found, each of these functions throws error (macro ends).
Great, its getting there. I kinda miss the MEMBER part lol.
Problem is, the macro I am running from another file is using other Functions from that file. It did start the macro but stopped because the functions do not exists in the current macro.
When I tried the run and mac commands, I was able to open the file but it does not run the macro. I guess since the original macro was already closed, that is why.
Is it possible to DISABLE a function? I was able to find dis command but it is only for triggers. I imported the macro and everything seems ok except, I need to disable one function to make it work.
Rename or delete all items with duplicate names. Especially functions. Only folders can have same names. Don't rename or delete items in System folder.
If there are to functions with same name, one of them is disabled, and error message probably is displayed.
To disable a function, convert it to macro: in Properties, select Macro where now you see Function.
Would this approach also help me with files that are longer than 32K characters.
I have one macro which I made in Word pad but it happens to have more than 32k characters, so in the UI for pasting the macro it bombs. What should I do?
Depends on what the macro should do. If it should paste the text, save the text to a file, and let the macro get the text from the file. If the text is QM code, divide it into several functions.
My macro needs to do the following:
key "MM" T "6999" T "ABC123455"
1
key F10
1
key F10
1
key "LO" T "6777" T "ABC123456"
1
key F10
1
key F10
1
repetitively, these numbers are in an excel sheet. I already have the macro edited into multiple <32k files but QM does not run each statement in order, it keeps on running the last file only. This is similar post as in a previous post. Thanks.
Now all this data is stored in macro. Do you really need this? Maybe better would be to get it directly from the worksheet? Macro could do it programmatically, without keys, and, if needed, even without showing Excel. Then the macro could repeat for each row. Also is possible to export the worksheet to a csv file, and the macro can parse it.