tomashen Posted November 2, 2011 Share Posted November 2, 2011 hi forumers as the title says i wana do that ..for example this is example.txt guicreate("example gui", 200, 200) guisetstate() while 1 wend and the example.exe will run that example.txt as a script liked compiled script but the script will be in a txt file. is this posible? if yes how? :S and thnx Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
guinness Posted November 2, 2011 Share Posted November 2, 2011 Yes, look at /AutoIt3ExecuteScript in the Help file & Forum. 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...
tomashen Posted November 2, 2011 Author Share Posted November 2, 2011 thnx found it and worked very nice! Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 um i got problem ... im using this comamnd to run a txt file with source code Run(@AutoItExe & " /AutoIt3ExecuteScript " & "file.txt") but i dont want to actualy run it.. i want to include the data from the text file so it will act as if its being runned from the text file Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
guinness Posted November 3, 2011 Share Posted November 3, 2011 Look at #include in the help file. 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...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 Look at #include in the help file.nope :/ i want something like #include but i dont want the text file to be inside exe i want the text to be just included into the exe when exe is opened and exe needs some data at certain lines Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 any helps lads? Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 3, 2011 Moderators Share Posted November 3, 2011 tomashen, Do not be so impatient - please wait 24hrs before bumping your own thread. i want the text to be just included into the exe when exe is openedI do not belive this is possible without running the file - as explained by guinness above. exe needs some data at certain linesBut this is. You would need to read the file as the exe starts (FileRead or _FileReadToArray) and then parse the content when needed. The example you gave in the original post is of the first type - you cannot "inject" code into the exe - you can only run it externally. However, if what you want is "data" to be acted UPon by the exe then you can easily do what I explained above. Which is it you really want to do: M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 thnx for the reply and sry for bumping so early but on the topic now i want the kind of thing like with FileRead u know... i tryed using "iniread" but that is only for .ini files so i want to use txt file not ini so u say if i do FileRead("example.txt") at the very begining of exe loading then i what i do ? maybe i do sumtin like : for example now i wana have a progress bar in the gui but the progress bar code has to be in example.txt so i write in the exe FileReadLine("example.txt", 5) and then what? Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 3, 2011 Moderators Share Posted November 3, 2011 tomashen,but the progress bar code has to be in example.txtI have already explained - you cannot run code that is in an external file unless you do as guinness explained and use /AutoIt3ExecuteScript on a valid AutoIt script. Why do you insist on sections of your code being external to the exe file? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 if i use /AutoIt3ExecuteScript then i cant put variables or anything on txt file bcz that requires the "#include" files... ;/ i just wana put some of the code into txt file so that i can edit the gui on the go if i dont have the autoit on the pc is there no way to do sumtin like #include does? like #include "example.txt" at certain points of lines ? Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 3, 2011 Moderators Share Posted November 3, 2011 tomashen,#include only works at compile time - it cannot work at run time. so that i can edit the gui on the go if i dont have the autoit on the pcThen you need to use /AutoIt3ExecuteScript and run an external script. Remember that the external file does not need to have a .au3 extension - you can use any extension you want (added because GEOSoft has just PM'd me!). M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 hm would i be able to do something like FileReadLine(Run(@AutoItExe & "/AutoIt3ExecuteScript" & "example.txt"), 1) read and run first line out of the txt? just go a hint of that lol im sry for being pain in the ass heh but noobs can learn only from pros tell me im wrong.. ;D Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
BrewManNH Posted November 3, 2011 Share Posted November 3, 2011 How about showing us exactly how you want the text file to be formatted, a working example of exactly what you would like in one as an example. If you're thinking to do something like this: guicreate("example gui", 200, 200) guisetstate() while 1 Sleep(10) wend 12 example of something in the text file "some random text" MsgBox(64, "Error", "Random error message") If you're looking for something like that where you're mixing code and random text, then you're going to have to be able to figure out what's random text and what's code and how you're going run that random code. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 3, 2011 Moderators Share Posted November 3, 2011 tomashen,hm would i be able to do something likeNO! Please try and understand - what you want is impossible. However, you can go some way towards your goal by using the information we have already given you - namely /AutoIt3ExecuteScript. im sry for being pain in the assYou have just used up your PIA points for next few years! M23P.S. And now I hand over to BrewManNH - and the very best of luck to him! Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 (edited) "use example.txt here to insert a "guicreate" line here" <br><br><br>GUISetState(@SW_SHOW)<br><br> While 1<br> Switch GUIGetMsg()<br> Case $GUI_EVENT_CLOSE<br> ExitLoop<br> EndSwitch<br> WEnd i wana sumtin like this BrewManNH but as Melba23 sayd its imposible then that sux hm also as melba u sayd FileRead("lala.txt") at begining... then how can i pick up some line from that file to insert into a line on exe upon execution of .exe ? Edited November 3, 2011 by tomashen Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
Developers Jos Posted November 3, 2011 Developers Share Posted November 3, 2011 What about you try to: - write normal English for starters. - start reading about the Autoit3 language - be clear about your intentions and first try some coding yourselfa? I am sure your life will be easier in this forum. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 (edited) im not english so... cant write any better english than this... ive read autoit 2-3 years ago and today and im trying all i can think of but i fail hers what i just tryed lol $LINE = FileRead("gui.txt") Run(@AutoItExe & ' /AutoIt3ExecuteScript ' & $LINE) ;here i want it to insert a one line from the gui.txt fle.... GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd and here is what the gui.txt file has guicreate("test", 200, 200) Edited November 3, 2011 by tomashen Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
BrewManNH Posted November 3, 2011 Share Posted November 3, 2011 (edited) Form4: AutoIt3.exe [/ErrorStdOut] /AutoIt3ExecuteLine "command line" Execute one line of code. To execute a single line of code, use the command: Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi!'')"') From the help file. Just be aware, you will only be able to run one line at a time, and they won't interact with each other, in other words, you can't run functions line by line or loops, it doesn't work that way. Edited November 3, 2011 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
tomashen Posted November 3, 2011 Author Share Posted November 3, 2011 i saw this and tryed but maybe i used it wrong i duno... but dont work for me :/// any advice ? or example ? heres how i use it Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & Fileread("gui.txt")) and i get errorslike this is what the file hasguicreate("test", 200, 200) Proud of AutoIt Proud of MySelf :) 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