Jump to content
Macro Express Forums

Text Box Display optional?


Recommended Posts

I have a macro which runs a Python program. I end the macro with Text Box Display to show any console output from the program. Is it possible for Text Box Display not to activate if there is no console output from the program? Also, is there some way of showing console output in a display that closes after a set interval without the user having to click "OK"?

Link to comment
Share on other sites

Variable Set String %ConsoleValue%: Prompt
Variable Set Integer %Length% to the length of variable %ConsoleValue%
If Variable %Length% Is Greater Than "0"
  Text Box Display: Console values
  Delay: 3 seconds
Else
  Beep
End If
<VARIABLE SET STRING Option="\x01" Destination="%ConsoleValue%" Prompt="Enter text to simulate console value. (OK to enter nothing)" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="%Length%" Text_Variable="%ConsoleValue%"/>
<IF VARIABLE Variable="%Length%" Condition="\x03" Value="0" IgnoreCase="FALSE"/>
<TEXT BOX DISPLAY Title="Console values" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs32 %ConsoleValue%\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x01" Delay="3"/>
<DELAY Flags="\x01" Time="3"/>
<ELSE/>
<BEEP/>
<END IF/>

 

Link to comment
Share on other sites

Yes.  What acantor said.  You said you don't want the macro to activate, but I suspect you really mean that you don't want it to do the Text Box Display if there is nothing to display.  If it simply activates and runs for a fraction of a second, and ends without displaying anything, that should be satisfactory. 

Link to comment
Share on other sites

  • 2 months later...

I said was there a way for the text box not to activate (meaning "appear") if there was no console output from the program. I do not know how to obtain acantor's script. Is %ConsoleValue% provided by Macro Express Pro, or do I have to create or populate it somehow? Or is it set to "Prompt" and "Prompt" picks up the console output from the program? I need a "Do this, do that" kind of answer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...