jsampsonyyyyy Posted June 11, 2019 Report Share Posted June 11, 2019 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"? Quote Link to comment Share on other sites More sharing options...
acantor Posted June 11, 2019 Report Share Posted June 11, 2019 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/> Quote Link to comment Share on other sites More sharing options...
rberq Posted June 12, 2019 Report Share Posted June 12, 2019 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. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted August 21, 2019 Author Report Share Posted August 21, 2019 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. Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 21, 2019 Report Share Posted August 21, 2019 To copy the macro: highlight acantor's example in the second box (the one that starts with <VARIABLE) , type Ctrl+c to copy to the clipboard, open a new macro in Macro Express and type Ctrl+v to paste. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted August 21, 2019 Author Report Share Posted August 21, 2019 I see. It is a simulation. Is there a way of getting the console value into %ConsoleValue%? Quote Link to comment Share on other sites More sharing options...
kevin Posted August 21, 2019 Report Share Posted August 21, 2019 If you launch a program via the Program Launch command there is an option to save the console information to a variable. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted August 22, 2019 Author Report Share Posted August 22, 2019 Many thanks. I have found it now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.