Jump to content

Restart script in SciTe


Recommended Posts

  • Moderators

What version of AutoIt and SciTe are you using? In the latest version, on both WIN7 and WIN8, it works fine for me.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Any script. this is not script related.

if you tell me that this works for all of you , then something in my computer needs to be done.

thanks

ex.

$file = FileOpen("test.txt", 10) ; which is similar to 2 + 8 (erase + create dir)

If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileClose($file)
Link to comment
Share on other sites

  • Moderators

My understanding of the restart function was that it will restart a running script, your example ends before you could restart it. Try this, which restarts just fine for me.

HotKeySet("{F1}", "count")

Global $x = 0

While 1
    $x += 1
    Sleep(250)
WEnd


Func count()
    MsgBox(0, "", $x)
EndFunc
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Developers

Try this script and hit Ctrl+Alt+F5 to restart in stead of "ctrl+Break , and F5" you specified!

For $x = 1 To 100
    Sleep(1000)
Next

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

The way that the script is restarted with Ctrl+Alt+F5 is done by AutoIt3Wrapper, it sets a hotkey for that combination, and if you press it it does a processclose on the running script and then just reruns the script the same way it started it the first time. No ctrl-break used.

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

Link to comment
Share on other sites

  • 5 months later...

I have the same problem with AutoIt3Wrapper v.2.2.0.3, SciTE v.3.4.1.0 and autoit 3.3.11.6 (or 3.3.12.0)

No script restarts.

This simple script:

local $i=0
while 1
    ConsoleWrite($i)
    $i +=1
    sleep(1000)
WEnd

doesn't restart

I found anyway in the Menu Tools the line:

SyntaxCheck Beta with the same Ctrl+Alt+F5

Could it be that?

But I changed it in au3.properties and nothing happens.

Edited by frank10
Link to comment
Share on other sites

  • Developers

I have the same problem with AutoIt3Wrapper v.2.2.0.3, SciTE v.3.4.1.0 and autoit 3.3.11.6 (or 3.3.12.0)

No script restarts.

This simple script:

local $i=0
while 1
    ConsoleWrite($i)
    $i +=1
    sleep(1000)
WEnd

doesn't restart

I found anyway in the Menu Tools the line:

SyntaxCheck Beta with the same Ctrl+Alt+F5

Could it be that?

But I changed it in au3.properties and nothing happens.

Agree I've picked the "wrong" shortcut here by using the same as shortcut as defined for "Syntaxcheck Beta", but when taking your script and running it in SciTE, the Ctrl+Alt+F5 works fine for restarting the script every time.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I solved it changing line 1065 in the AutoIt3Wrapper.au3:

HotKeySet('^!{F6}', 'Run_the_Script')

(and line 1085):
 

ConsoleWrite('--> Press Ctrl+Alt+F6 to Restart or Ctrl+Break to Stop' & @CRLF)

and compiling the wrapper again.

But I don't know why it didn't work with F5...

Anyway, solved it.

Edited by frank10
Link to comment
Share on other sites

  • Developers

I have already made the change for the next version to use "Ctrl+Alt+Break to Restart" to avoid any conflict and just uploaded it to the Beta directory.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...