Jump to content
Sign in to follow this  
torels

how do I run a tmp au3 file via code ?

Recommended Posts

torels

I am actually writing a program wich runs scripts even if they aren't saved on the computer but I can't manage to open the tmp files passing through the Autoit3.exe file ?

this is the code:

#include <file.au3>

$file = _TempFile(@TempDir,"~",".au3")

FileOpen($file,2)
FileWrite($file,_ReadScite())
FileClose($file)
run(@ComSpec & " /C " & '"' & @AutoItExe & '" "' & $file & '"')

FileDelete($file)

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")

return ClipGet()
EndFunc

does anyone know how to solve the problem ?


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites
martin

I am actually writing a program wich runs scripts even if they aren't saved on the computer but I can't manage to open the tmp files passing through the Autoit3.exe file ?

this is the code:

#include <file.au3>

$file = _TempFile(@TempDir,"~",".au3")

FileOpen($file,2)
FileWrite($file,_ReadScite())
FileClose($file)
run(@ComSpec & " /C " & '"' & @AutoItExe & '" "' & $file & '"')

FileDelete($file)

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")

return ClipGet()
EndFunc

does anyone know how to solve the problem ?

This is what I do to run a script.

$AutoItProdexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir");installDir for production
$AutoItBetaexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaInstallDir");installDir for beta
$AutoItexePath = $AutoItProdexePath;default to prod

Run('"' & $AutoItexePath & '\AutoIt3.exe "' & ' "' & @ScriptDir & '\' & $file & '"')

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
torels

Thanks! It's working fine now :)


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.