﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
338	Run scripts with no need to save them	torels	Jos	"I think it's a good idea to insert a ""Run"" voice in SciTe which runs the script even if it's not saved

I wrote an AutoIt script which does the work, but it would be much better in LUA, even because the script I wrote always comes up with a message from SciTe asking me to save the file. By clicking NO the script starts.

I came uo with this:
{{{
#include <file.au3>
$file = _TempFile(@TempDir,""~"","".au3"")
$oldclip = ClipGet()
FileOpen($file,2)
FileWrite($file,_ReadScite())
FileClose($file)
$AutoItProdexePath = RegRead(""HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt"", ""InstallDir"")
$AutoItexePath = $AutoItProdexePath

Run('""' & $AutoItexePath & '\AutoIt3.exe ""' & ' ""' & $file & '""')

FileDelete($file)
ClipPut($oldclip)

Func _ReadScite()
Opt(""WinTitleMatchMode"", 4)

; Read text from SciTE (already open)
WinWait(""[CLASS:SciTEWindow; INSTANCE:1]"")
$hSciTE = WinGetHandle(""[CLASS:SciTEWindow; INSTANCE:1]"")
WinActivate($hSciTE)
WinWaitActive($hSciTE)
ControlFocus($hSciTE, """", ""[CLASS:Scintilla; INSTANCE:1]"")
ControlSend($hSciTE, """", ""[CLASS:Scintilla; INSTANCE:1]"", ""^a"")
ControlSend($hSciTE, """", ""[CLASS:Scintilla; INSTANCE:1]"", ""^c"")
ControlSend($hSciTE, """", ""[CLASS:Scintilla; INSTANCE:1]"", ""{left}"")

return ClipGet()
EndFunc
}}}

also see: [http://www.autoitscript.com/forum/index.php?showtopic=72697&st=0&p=530328&#entry530328]"	Feature Request	closed		SciTE4AutoIt		None	Rejected	run execute script scite	
