Jump to content
flyfamilyguy

Autoit3 and .ini files?

Recommended Posts

flyfamilyguy

Hello everyone.

Been browsing around a little bit through the forum, my brain spinning with ideas that I'm planning out as im typing here, so if anyone thinks that I have not spent enough time searching

for the answer in an archive somewhere, blame it on my excitement at getting back to my desktop before I forget wth I was going to do! :)

I ve been taking my time with an application that Im writing, scrapping things as new ideas come. Cant explain why really, but ive always liked the idea of incorporating both batch and Autoit in my programs so that's been the case with everything ive done to date. Currently I'm trying to focus on finishing through to a final result,  I guess you could call it a 'wysiwyg' html webpage and css creation utility. Its been run a hundred times or more and scrapped only to rewrite a few lines here and there due to my overactive brain matter. most of the code was done in batch . Interactive commandline, echoing tags and strings into files blah blah blah. The autoit portion comes as the Nice Gui interface with all the options for a webpage or css then once chosen the gui scribbles a couple of lines into a file where the batch code comes in, reads the file then executes predefined directives based on what was specified.

My question I swear!

I would really like to try out Autoit for the entire app from gathering the user specs to creation along with ini and maybe inf files. Is it possible for Autoit to read and execute from an .ini?

Thanks]

Sorry folks. Just scrolled down after posting and WAM, there by Golly were a bunch of 'related' topics on ini's!  but Ill still take any new input/ideas thanks

Edited by flyfamilyguy
update

Share this post


Link to post
Share on other sites
water

In short:
Sure, check the Ini* functions in the help file.

You will get more helpful advise when you have a question based on real code :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
flyfamilyguy

In short:
Sure, check the Ini* functions in the help file.

You will get more helpful advise when you have a question based on real code :)

​Hi First I'm real sorry that it has taken so long to respond. Unexpected and unwanted circumstances popped up so was far from pc and me time. I'm not sure I Understand what you mean by "..based on real code" my friend. The code is very real indeed and works quite well. It created the pages found here There is still much work to be done with it but all in all it's coming along. I was at the time searching for ways to kind of veer away from batch and especially  begin using configuration files such as ini. to make the writing a little easier and less of it. Also just about every character/tag in html is recognized by comspec as something completely different resulting early on in a lot of errors and incomplete files being produced. I finally managed to get around this (Windows cmd.exe tolerates a lot of abuse. not real strict with the language to say the least) so...

But anyway, Thank you for the reply and yes I found the help section on ini. At the time for some reason (think it was something a friend said) I was thinking there was no 'ini and Autoit' so I didn't even bother to check and instead came straight here.

Share this post


Link to post
Share on other sites
JLogan3o13

Water was trying to point out that, without posting your code, you make it a little difficult on those trying to help. We have to first guess at what you're doing and then try to troubleshoot. Your first post in any topic should always include code - if not the whole code then at least a short reproducer that demonstrates the problem.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
water

Couldn't have worded it better :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      hi dears
      am using an ini files as a History
      Sometimes the file size is be larger to 5 MB
      AutoIt does not recognize the full content of the file
      When I did a search to find out why, I discovered that INI files could not be read if they size larger than 64 KB.
      for that I preferred to ask here if is there any way to bypass this obstacle.
      The contents of the file are  as follows
      [filesList]
      c:\...\...\f1.mp3=00:15:20
      c:\...\...\f2.mp3=00:10:20
      c:\...\...\f3.wav=00:59:20
      ....... Etc
      This is the section for reading the file (adapted from my main script)

      case $continue     Local $aArray = IniReadSection($WaitingListFile, StringEncrypt(true, "filesList", $MyPassword))     If Not @error Then Opt("GUICloseOnESC", 1) _GUICtrlListView_DeleteAllItems($scList)         For $i = 1 To $aArray[0][0] $path = path_list(StringEncrypt(false, $aArray[$i][0], $MyPassWord), 1) if FileExists(StringEncrypt(false, $aArray[$i][0], $MyPassWord)) then GUICtrlCreateListViewItem(_GetFileName(FileGetLongName(StringEncrypt(false, $aArray[$i][0], $MyPassWord))) & Opt("GUIDataSeparatorChar") & " : " & Opt("GUIDataSeparatorChar") & FileGetLongName(StringEncrypt(false, $aArray[$i][0], $MyPassWord)), $scList) else $path = $path endIf         Next GUISetState(@sw_disable, $hGUI) GUISetState(@sw_show, $hGUI2) GUICtrlSetState($SClist, $GUI_FOCUS) else if $accessibilitymode = 1 then speak(str("listEmpty")) endIf endIf
      Is there any way to solve this problem, please?
      am waiting your answers...
      Greetings to All
    • AndreasNWWWWW
      By AndreasNWWWWW
      Hi, i'm just curious is there a way to sort an ini file after largest first?
      my inifiles writes itself like this
      14=500
      13=GREY
      12=500
      11=600
      10=600
      9=600
      8=700
      7=700
      5=600
      3=600
      2=800
      1=700
      15=GREY
      4=GREY
       
      but is there a way so i can get it sortet 
      15
      14
      13
      12 
      etc?
    • AndreasNWWWWW
      By AndreasNWWWWW
      Hi, i'm curious if this is even possible, i want to do an action if the ini file contains current values under a section.
      for my test i'm looking for 100,200,300,400,500
      and if any of those excits i want to pop a msgbox with the number in the section.
      i can in my example find one, but it does not check everyone. why?  what am i missing?
      Local $iscore810[5] = [100,200,300,400,500] Local $iMax800 = 5 While 1 ;~     Send("{pause}") ;;func les ini fil     $var = IniReadSection("Area.ini", "modus")     If @error Then         MsgBox(4096, "Error", "Unable to read section.")     Else          For $number = 1 To $var[0][0] If $var[$number][1] == $iscore810[3] Then       MsgBox($MB_SYSTEMMODAL, "FAnt den på", $var[$number][0], 5) EndIf                       Next     EndIf     exit WEnd  
    • Pike
      By Pike
      Hello Everyone,
      New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help.
      1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click.
      2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much!
      Pike
    • kartune
      By kartune
      Hi, i would like to know if there is a possible way to use subsections for ini files?
      For example, my ini file would look something like this:
       
      Clientname.ini
      [Info]
      Country=USA
      Type=Distributor
       
      [Costs]
      [[JAN]] <----- subsection
      cost1=----
      cost2=----
      [[FEB]]
      cost1=----
      cost2=----
       
      [Sales]
      [[JAN]] <----- subsection
      sale1=----
      sale2=----
      [[FEB]]
      sale1=----
      sale2=----
       
      [Profits]
      [[JAN]] <----- subsection
      prof1=----
      prof2=----
      [[FEB]]
      prof1=----
      prof2=----
       
      The sales would be inputed everyday by the script, and then whenever viewed, i would be using an array to view every sale/cost/profit under the subsection
       
       
      Thanks for your time!
×