Examples of setting and getting data from an ini file. the last parm is a default if none exists. Global: Dim myINIFile : myINIFile = ClientInformation.ScriptPath & "\Cuckoo_Clock.ini" Dim myXMLFile : myXMLFile = ClientInformation.ScriptPath & "\Cuckoo_Clock.xml"
You have variable types inside the ini file and one is text and the other a number. Note assigning to itself here but others have the default variable at the end or you can assign to them. Sub InitIni() INIFile(myINIFile).Text( "Configuration", "Announcement") = INIFile(myINIFile).Text( "Configuration", "Announcement", "ChimeOnly") INIFile(myINIFile).Number( "Configuration", "Enhance_Hotkey") = INIFile(myINIFile).Number( "Configuration", "Enhance_Hotkey", False) End sub Sub SendToIniFileTimeFormat( idName) ' Send to iniFile the time format setting. INIFile(myINIFile).Number( "Configuration", "TimeFormat") = dictMyMenuTimeFormatItems( idName) Speak " You selected " & dictMyMenuTimeFormatItems( idName) & " Hour Format ", speakerVoice getCuckooSettings ' Reset flags because of above toggle. SetTheAnnounceTimer previousAnnounceHour Sleep 1000 End Sub Sub setTtsSettings() editSoundFile = myTtsDialog.Control( "edit_tts_path").Text & myTtsDialog.Control( "edit_tts_filename").Text ttsVoiceNum = myTtsDialog.Control( "cmb_voice").SelectedItem -1 xmlVolume = myTtsDialog.Control( "cmb_volume").Text( myTtsDialog.Control( "cmb_volume").SelectedItem) xmlRate = myTtsDialog.Control( "cmb_rate").Text( myTtsDialog.Control( "cmb_rate").SelectedItem) xmlPitch = myTtsDialog.Control( "cmb_pitch").Text( myTtsDialog.Control( "cmb_pitch").SelectedItem) ttsAudioFormat = myTtsDialog.Control( "cmb_format").SelectedItem INIFile(myINIFile).Number( "TtsEngine", "voice", 0) = ttsVoiceNum INIFile(myINIFile).Text( "TtsEngine", "volume", 100) = xmlVolume INIFile(myINIFile).Text( "TtsEngine", "rate", 0) = xmlRate INIFile(myINIFile).Text( "TtsEngine", "pitch", 0) = xmlPitch INIFile(myINIFile).Number( "TtsEngine", "format", 35) = ttsAudioFormat End Sub Sub getTtsSettings() 'Ini File TTS Settings. ttsVoiceNum = INIFile(myINIFile).Number( "TtsEngine", "voice", 0) xmlVolume = INIFile(myINIFile).Text( "TtsEngine", "volume", "100") xmlRate = INIFile(myINIFile).Text( "TtsEngine", "rate", "2") xmlPitch = INIFile(myINIFile).Text( "TtsEngine", "pitch", "0") ttsAudioFormat = INIFile(myINIFile).Number( "TtsEngine", "format", 35) End Sub Sub SendToIniFileHourlySetting( idName) ' Send to iniFile the hourly setting. INIFile(myINIFile).Number( "Configuration", "HourlySetting") = dictMyMenuHourlySettingItems( idName) Speak myStrings( idName) & myStrings( "selected"), speakerVoice getCuckooSettings ' Reset flags because of above toggle. SetTheAnnounceTimer previousAnnounceHour Sleep 1000 End Sub Sent: Tuesday, October 18, 2016 7:03 PM Subject: can window eyes scripting write and read string to and from inifile Hi, i am still new to window eyes scripting, and before this i use the other screen reader, the compatitor. so, let's say i want something to be written to ini file, can window eyes scripting do that? if yes, what function? sorry and thanks _______________________________________________ Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ai Squared. For membership options, visit http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/lab4me%40fltg.net. For subscription options, visit http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com List archives can be found at http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus _______________________________________________ Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ai Squared. For membership options, visit http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/archive%40mail-archive.com. For subscription options, visit http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com List archives can be found at http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com