My macro outputs some information to this kind of window. I change the name of the tool or the information on this window disappears. How can I keep it all the time?
Solved! Go to Solution.
Solved by TK.421. Go to Solution.
see this thread for infobox information. should have everything you need!
You need to capture the existing text in the info box as a string. I think there’s a couple examples in that link and the link in that thread. If you still are having trouble, I can look in the morning when I get to work, I’ll post up my code
You can write the current text to a file and then recall it from there, and when you make your change, refresh the box information via another macro
i copied the macro i use for my project notes and threw in an example of writing to and reading from a text file.
This is very sloppy and you'll have to play around with it to clean it up, but this is where I was going with this
// Variables for the info box message
STRING existing = ""
STRING msg = ""
STRING notes = project.notes
// set the temp file location
STRING filePath = "C:/temp/temp.txt"
// open the temp file and read any existing notes
FILE OPEN $filePath FOR READ AS "file1"
FILE READ $existing FROM "file1"
FILE CLOSE "file1"
// Create my info box & write the
// formatting example
INFOBOX NEW "Project Notes & User Parameters"
INFOBOX STYLE "Normal"
STRING s = "Project Notes" + crlf
INFOBOX STYLE "Warning"
INFOBOX STATE "Bold" TRUE
INFOBOX STATE "underline" TRUE
INFOBOX APPEND $s
INFOBOX STATE "underline" FALSE
INFOBOX STATE "Bold" FALSE
// append the existing notes to whats in the file
$notes = $notes + $existing
INFOBOX APPEND $notes
// Write the existing info to a text file
FILE OPEN $filePath FOR WRITE AS output
FILE WRITE $notes TO output
FILE CLOSE output
glad it helped!
Can't find what you're looking for? Ask the community or share your knowledge.