UnKnOwned Posted April 27, 2013 Share Posted April 27, 2013 This may seem a rather silly question, and am not quite sure what to even ask, but can you store Autoit it code inside a variable and execute it later? Something like $val = msgbox(0, '', 'Hello') $val ------ execute it here or something... Is there a way to do this? Thank you in advance. Link to comment Share on other sites More sharing options...
JohnOne Posted April 27, 2013 Share Posted April 27, 2013 Execute() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
PhoenixXL Posted April 27, 2013 Share Posted April 27, 2013 Execute will get you any expression's value, for assigning any value to a variable use Assign, Execute won't work there. My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
OliverA Posted April 27, 2013 Share Posted April 27, 2013 (edited) It's not better tu use a Func? Func Msg() msgbox(0, '', 'Hello') EndFunc ; Blabla Msg() ; --> Start hello MsgBox Edited April 27, 2013 by OliverA I'M QUIT FROM THIS FORUM! It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself. In what way? It's easy...just search on google For that people, wish you the best way, Oliver Astone Link to comment Share on other sites More sharing options...
Malkey Posted April 27, 2013 Share Posted April 27, 2013 This example stores an Autoit MsgBox command code inside a variable and executes it later. Local $Ret, $aMsgRetVal[8] = [8, "OK", "CANCEL", "ABORT", "RETRY", "IGNORE", "YES", "NO"] Local $val = "MsgBox(2, 'MsgBox inside variable', 'Hello')" $Ret = Execute($val) MsgBox(0, "Execute($val) returned", $Ret & " is returned for " & $aMsgRetVal[$Ret] & ".") Link to comment Share on other sites More sharing options...
AZJIO Posted April 27, 2013 Share Posted April 27, 2013 $val = "MsgBox(0, '', 'Hello')" Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $val & '"') My other projects or all Link to comment Share on other sites More sharing options...
UnKnOwned Posted April 28, 2013 Author Share Posted April 28, 2013 (edited) $val = "MsgBox(0, '', 'Hello')" Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $val & '"') The above seems to work similar to Execute() however with a multi line expression the same problem still ensues when trying to run 6D7367626F7828302C2027272C202748656C6C6F27290D0A6D7367626F7828302C2027272C2027576F726C642729 Which is =to msgbox(0, '', 'Hello') msgbox(0, '', 'World') Executing in this manner never works as the expression is trying to be passed as a whole instead of through a loop.?. We then end up with the following error. The binary string is retrieved from the registry converted back to a string & then needs to be executed as is without the need of a temp file dump. Unless there is a way to /Auto3ExecuteScript file or whatever it is without a file but rather a variable perhaps? I guess if it is needed to create a temp file then oh well but this defeats the whole purpose. My apologies had to edit as this topic is in reference to another question I had asked. Hopefully this will help to better understand what is I am looking to do. Edited April 28, 2013 by UnKnOwned Link to comment Share on other sites More sharing options...
guinness Posted April 28, 2013 Share Posted April 28, 2013 About the error, you need to pay close attention to the quotes. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now