Jump to content
Sign in to follow this  
z0mgItsJohn

Handy Tool (_Execute_Source_File)

Recommended Posts

Hello AutoIt Peoples :D I Made A Handy Tool..

~ Enjoy ~

Source : _Execute_Source_File.Au3

;====================================================================================
;= UFD Name............: _Execute_Source_File.Au3
;= Function............: _Execute_Source_File ($AutoItExe, $Script_File, $Mode)
;= AutoIt Version......: 3.2.10.0
;= Language............: English
;= Description.........: Lets You Run A Script File Without Compiling The Script
;= Author(s)...........: John O. Aka (John2006) And The (Help File)
;= Error Value.........: Returns 0 (@Error)
;= Succuess Value......: Returns 1
;===================================================================================
;= Notes...........................................................................:
;= $AutoItExe = @AutoItExe
;= $Mode = 0 ($Script_File Is The Same Drive As @ScriptDir .: Example : _Execute_Source_File (@AutoItExe, 'Test.Au3', '0')
;= $Mode = 1 ($Script_File Is Not The Same Drive As @ScriptDir .: Example : _Execute_Source_File (@AutoItExe, 'C:\Test.Au3', '1')
;= ................................................................................:
;====================================================================================

Func _Execute_Source_File ($AutoItExe, $Script_File, $Mode)
If Not FileExists ($File) Then
Return @Error
EndIf
If $Mode = ('0') Then
Run ($AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\' & $Script_File & '"')
Return ('1')
EndIf
If $Mode = ('1') Then
Run ($AutoItExe & ' /AutoIt3ExecuteScript "' & $Script_File & '"')
Return ('1')
EndIf
EndFuncoÝ÷ Ù*.­ÇÅ©©à.Ý«­¢+Ø%¹±Õ±Ðí}áÕÑ}M½ÕÉ}¥±¹ÔÌÐì()}áÕÑ}M½ÕÉ}¥±¡Õѽ%Ñá°ÌäíQÍйÔÌÌäì°ÌäìÀÌäì¤)}áÕÑ}M½ÕÉ}¥±¡Õѽ%Ñá°ÌäíèÀäÈíQÍйÔÌÌäì°ÌäìÄÌäì¤

And Please Post Comments Bugs.. Etc :D

~ John

Edited by John2006

Share this post


Link to post
Share on other sites

Good old Justin. Beauty through simplicity. Top notch


----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

Share this post


Link to post
Share on other sites

Nice! Might be useful for PPlayer (if Pascal didn't put "RIP" sign on it already...)

i dont understand how u think when u submit something like this

yo, i dont understand whats ur krazi spek zo talk normal english, gotcha? Edited by i542

Share this post


Link to post
Share on other sites

Why not just do this?:

If @Compiled = 0 Then Run(@AutoItExe & " " & FileGetShortName(@ScriptFullPath))
If @Compiled = 1 Then Run(@ScriptFullPath)

Its easy.

This, and the _Execute_Source_File() Won't work if the Computer running the Script doesn't have autoIt installed. But it's a nice function anyway ;D

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  

×
×
  • Create New...