Sign in to follow this  
Followers 0
TheCapulet

Novice questions

8 posts in this topic

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

Share this post


Link to post
Share on other sites



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. :shocked:

Once you have a good handle on how AutoIt works, look carefully at the following in the Help file:

GUICreate - for the dialog

GUICtrlCreateInput - to enter the filename

GUICtrlCreateButton - you will surely need one or two

FileCopy - you can guess this one!

Ini* commands - because then you can change the contents of an ini file directly

You 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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

These are exactly the functions I was looking for actually. ;)

Share this post


Link to post
Share on other sites

TheCapulet,

These are exactly the functions I was looking for actually

Excellent. 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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by TheCapulet

Share this post


Link to post
Share on other sites

IniRead(@MyDocumentsDir & "\somerandom.ini", ...)


♡♡♡

.

eMyvnE

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  
Followers 0