Page 1 of 1

Macro Notification Message box

PostPosted: Wed Sep 13, 2017 8:15 am
by oImageZo
Hi There,

I've created a macro for a very length process (takes around 15minutes and uses multiple applications) which is great and works - hoorah!

However, there are a few elements where the macro appears to the user it is doing nothing (wait times/background stuff) which is fine for me, because I know what it is doing. However I want to have other users use this macro but am afraid they will think it has crashed/stopped/died and will attempt to restart/take over manually.

I'm looking to just have a constant transparent message box style in the top corner just to display updates but am having a melt down trying to figure it out.

Any ideas?

Re: Macro Notification Message box

PostPosted: Wed Sep 13, 2017 8:47 am
by Gintaras
You can use function OnScreenDisplay. It displays transparent or tooltip-like text, depending on flags. Example:
Macro Macro1011     ?
OnScreenDisplay "Macro X is running" -1 -1 1 "" 0 0 8
rep 5
,wait 1

This macro changes OnScreenDisplay text while running:
Macro Macro1011     ?
sub.OSD "Starting..."
int i
for i 0 5
,sub.OSD i+1
sub.OSD "DONE"

#sub OSD
function str'text
OnScreenDisplay F"---- Macro X ----[]{text}" -1 -1 1 "" 12 0xff0000 8|4 "Macro X"


Or just use the Quick Macros tray icon, which changes color when a macro is running.
If it is a type of macro/function that does not change icon when running, or it is an exe-macro that runs not from QM, use function AddTrayIcon. Example:
Macro Macro1011     ?
AddTrayIcon "$qm$\macro.ico" "Macro X is running.[]You can Ctrl+click this icon to end it."
rep 5
,wait 1

But problem: Windows by default hides tray icons.