Choose Language Hide Translation Bar
Highlighted
DannyORegan94
Level II

Script that has the same function as the "Open as Plain text into Script window"

I have a GUI that I have created and I want to include a Help button in my GUI. Whne the user clicks the Help button I want an instructions.txt file to be opened in a script window for the user to be able to read. I know you can do this manually when opening .txt files using option mentioned in the subject but how do I write a script to do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Script that has the same function as the "Open as Plain text into Script window"

You just need to read the text file into a character variable, and then use the Script Box() function

Names Default To Here( 1 );
string = Load Text File("C:\..............");
Script = Script Box(
	string,
	"Text",
	300,
	100
);
New Window( "This is a script box", Script );
Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: Script that has the same function as the "Open as Plain text into Script window"

You just need to read the text file into a character variable, and then use the Script Box() function

Names Default To Here( 1 );
string = Load Text File("C:\..............");
Script = Script Box(
	string,
	"Text",
	300,
	100
);
New Window( "This is a script box", Script );
Jim

View solution in original post

Highlighted
DannyORegan94
Level II

Re: Script that has the same function as the "Open as Plain text into Script window"

Thank you very much!!

 

I was not aware of the Script Box command.

Article Labels

    There are no labels assigned to this post.