TheCapulet Posted October 28, 2010 Share Posted October 28, 2010 What I need to do is fairly simple, I think. But I can barely claim to have even a faint grasp on coding at this point, let alone a custom syntax that I've never used. I need to make a script that produces a dialogue box. Through options in the dialogue, I want it to be able to take a txt file (.ini file to be exact), back it up with a .ini_BAK file extention, then find multiple lines within the document to replace, then re save. I'll be sure to give credit to whoever helps me in this. Thanks, - The Capulet Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 28, 2010 Moderators Share Posted October 28, 2010 TheCapulet,Welcome to the AutoIt forum. When you post here it always helps if you have had a go at solving your problems beforehand. Having some code to work on is a great help - and no-one here is too keen to help the "code it for me" brigade. And being credited is not normally a high priority! As a beginner with Autoit (and we all started there at one point) reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading.I know you want to start coding NOW, but a little study will save you a lot of trouble later on, believe me. Once you have a good handle on how AutoIt works, look carefully at the following in the Help file:GUICreate - for the dialogGUICtrlCreateInput - to enter the filenameGUICtrlCreateButton - you will surely need one or twoFileCopy - you can guess this one!Ini* commands - because then you can change the contents of an ini file directlyYou know where we are if you run into difficulties. 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...
TheCapulet Posted October 28, 2010 Author Share Posted October 28, 2010 These are exactly the functions I was looking for actually. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 28, 2010 Moderators Share Posted October 28, 2010 TheCapulet,These are exactly the functions I was looking for actuallyExcellent. Good luck with the coding! 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...
TheCapulet Posted October 28, 2010 Author Share Posted October 28, 2010 Any idea how I can set a file name option to a standard folder instead of a root dir, such as my documents? I've tried both the class ID as well as %A_MyDocuments%, but it keeps directing to the desktop instead. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 28, 2010 Moderators Share Posted October 28, 2010 TheCapulet,I have not got the faintest idea of what you are asking. Where do you want to "set a file name option"? If you want to do it in a FileOpenDialog then just set the "init dir" parameter. 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...
TheCapulet Posted October 28, 2010 Author Share Posted October 28, 2010 (edited) Such as any point where you have to set a file name as a parameter. For instance, say I'm using "IniRead ( "filename", "section", "key", "default" )" When I use "IniRead ( "%A_MyDocuments%/somerandom.ini" )" or I use the MyDocuments Class ID instead, it tries to find the file on the desktop instead. Doing it 'without' an end user dialogue is kinda what I'm going for here. Edited October 28, 2010 by TheCapulet Link to comment Share on other sites More sharing options...
trancexx Posted October 28, 2010 Share Posted October 28, 2010 IniRead(@MyDocumentsDir & "\somerandom.ini", ...) ♡♡♡ . eMyvnE 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