Sign in to follow this  
Followers 0
xuzo

How to "lock" scite window, so script can't write to it?

11 posts in this topic

Sometimes I have some scripts that are running, for example, some send Keys on a notepad++ window, like {alt} and keystrokes.

If the notepad++ window closes for a variety of reasons...

The script keeps running on the the Scite window and destroys all the code ;(

Is there a way to "Lock" the scite window during F5 , so that no code can be written to it?

Share this post


Link to post
Share on other sites



I found a way by simply making the file read only with Scite:

Options >> Read Only

I suppose that's the way to do this?

Share this post


Link to post
Share on other sites

Don't use notepad or notepad++ at all...use filewrite.

1 person likes this

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

To answer the base question: When you have the full SciTE4AutoIt3 version installed you could also use:

#AutoIt3Wrapper_Run_SciTE_Minimized=            ;(Y/N) Minimize SciTE while script is running. Default=N

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

This solution works pretty good:

#AutoIt3Wrapper_Run_SciTE_Minimized=Y

Is it 100% safe? Absolutely NO keystroke can re-maximize and cause havoc?

The read only option works pretty good, but it's tedious to click it on and off all the time.

"Alt+O+R" works , but not efficient, is there a way to toggle read only? A macro? Can I create a shortcut for that?

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The script is so save as you worked accurate. When you using MouseClick's in your Script with false coordinates maybe the Scite-window get's keystrokes. When using ControlSend with a wrong the Handle of the Scitewindow or when using Title to identify Window and the Scitewindow has the same title maybe something is going wrong.

Everything what happens is initiated by your code and when he is bugy then find the bugs and fix them.

A little Tip, send only KeyStroke, Museclicks when the Application you want to automate is the active Window.

If WinActive($hwndGame) Then ...

 

Edited by AutoBert

Share this post


Link to post
Share on other sites

I'd avoid using Send unless there's absolutely no other way to do something. Send is an extremely unreliable method of automating a program, ControlSend, ControlCommand, and ControlClick are much more reliable.

As you've described, your problem is showing how unreliable Send is, don't use it if you don't have to.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

My script example has no "send" commands at all.

The script is NOT stopping with "Ctrl+break", regardless what I try.

I need to be able to stop the script when something goes wrong, I don't want it to run like a fully compiled .exe on every run.

I want it to stop, force stop, like CTRL+Alt+DEL

Stop on the Scite window, stop everywhere, just STOP ;)

Edited by xuzo

Share this post


Link to post
Share on other sites

My script example has no "send" commands at all.

In this thread there ins't a example script! But did you know what you postet Tuesday?

Sometimes I have some scripts that are running, for example, some send Keys on a notepad++ window, like {alt} and keystrokes.

If the notepad++ window closes for a variety of reasons...

The script keeps running on the the Scite window and destroys all the code ;(

and the answer to stop your nonsence script in:is given in this thread.

Btw.: it can't be a real reproducer from your problem script.

So it's  wasted time to try to help you until you show a real reproducer or your original script.

Also possible solution's are already given:

 

A little Tip, send only KeyStroke, Museclicks when the Application you want to automate is the active Window.

If WinActive($hwndGame) Then ...

 

I'd avoid using Send unless there's absolutely no other way to do something. Send is an extremely unreliable method of automating a program, ControlSend, ControlCommand, and ControlClick are much more reliable.

As you've described, your problem is showing how unreliable Send is, don't use it if you don't have to.

you just have to do what your are advised!

 

Share this post


Link to post
Share on other sites

This solution works pretty good:

#AutoIt3Wrapper_Run_SciTE_Minimized=Y

Is it 100% safe? Absolutely NO keystroke can re-maximize and cause havoc?

The read only option works pretty good, but it's tedious to click it on and off all the time.

"Alt+O+R" works , but not efficient, is there a way to toggle read only? A macro? Can I create a shortcut for that?

 

NO ... you need to take care of that by writing a smart script. ;)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0