Modify

Opened 17 years ago

Closed 17 years ago

#338 closed Feature Request (Rejected)

Run scripts with no need to save them

Reported by: torels Owned by: Jos
Milestone: Component: SciTE4AutoIt
Version: Severity: None
Keywords: run execute script scite Cc:

Description

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

Attachments (0)

Change History (5)

comment:1 Changed 17 years ago by TicketCleanup

  • Version 3.2.12.0 deleted

Automatic ticket cleanup.

comment:2 follow-up: Changed 17 years ago by Jos

I have no idea why this would be usefull. could you explain how it will be ?

comment:3 in reply to: ↑ 2 ; follow-up: Changed 17 years ago by anonymous

Replying to Jos:

I have no idea why this would be usefull. could you explain how it will be ?

So you avoid saving the script the first time you run it (selecting path and everything) mainly...
and for test scripts also...

otherwise I alwas have to save a new file just to run a test script found on the forum XD

comment:4 in reply to: ↑ 3 Changed 17 years ago by Jos

Replying to anonymous:

Replying to Jos:

I have no idea why this would be usefull. could you explain how it will be ?

So you avoid saving the script the first time you run it (selecting path and everything) mainly...
and for test scripts also...

otherwise I alwas have to save a new file just to run a test script found on the forum XD

I understand what you have done, but still do not see the big advantage and am really worried people would use this and then "forget" to save it when done.
By the way, you can avoid the save prompt by addding that parameter to the option:
command.save.before.0=2

Jos

comment:5 Changed 17 years ago by Jos

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.