InTouch 10.0 - How to close already opened file

Missy5

Member
Join Date
Jul 2008
Location
NG
Posts
24
Hi,

I have file "test.csv" where I am writting some values.

And I have one button that opens this file "test.csv" when
I press on.

Code for button:
IF InfoAppActive( InfoAppTitle("notepad C:\test.csv")) == 1 THEN

ActivateApp InfoAppTitle("notepad C:\test.csv");

ELSE

StartApp ("notepad C:\test.csv");

ENDIF;

I would like to check if this file is already opened, in case if it is than I'd like to close it!
How can I do that - check if the file is already opened?

Thanks, M.
 
theDave2 I tried your solution but it didn't work.

I paste your code to button action, I had my test.csv open and I
pushed this button and nothing happened.


I tested my code pasted above and I figured out that the first part never executes. When I press on button
I get one more notepad window test.csv opened not just one.
Why I don't know!
 
Last edited:
Here is the code that works!

IF InfoAppActive ( "test.csv - Notepad" ) == 1 THEN
ActivateApp ( "test.csv - Notepad" );
ELSE
StartApp ("Notepad C:\test.csv");
ENDIF;

And code to close file in case that is already opened:
WWControl ( "test.csv - Notepad", "CLOSE" );

Thanks for help, M
 
I set up a quick test.

InfoAppTitle("notepad C:\test.csv") on the screen shows nothing.

InfoAppTitle("notepad") shows "test.csv - Notepad"

So either change the above or perhaps use:

IF InfoAppActive("test.csv - Notepad") == 1 THEN

The parameter of InfoAppActive must match exactly and is case sensitive.

I tried this:

text3 = InfoAppActive("test.csv - Notepad");

WWControl (text3, "Close");

and it closed the window. Of course, if there is changed text there is a prompt to Save the changes.


In any case, test each function by itself to see that it returns (or what does) what you expect. Then when everything is tested by itself, start combining together.
 

Similar Topics

Hi all. Customer wants analog faceplates really bad, even if we explained that it doesn't make much sense in his process. What he wants to see...
Replies
5
Views
102
Trying to export a Modern application for an upgrade to Intouch 2020 but I cannot export the application from the 2014 version because the export...
Replies
2
Views
103
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
135
Currently we have a fat( I think that is what it is called) Intouch application. An application resolution of 3840x1080, and inside that 2x...
Replies
0
Views
87
Hi guys We're in the process of creating a ME runtime to operate on a PC running windows using a InTouch INDT156 touchscreen, and we're having an...
Replies
3
Views
139
Back
Top Bottom