D3fr0s7 Posted December 2, 2022 Share Posted December 2, 2022 (edited) #include <Misc.au3> MsgBox ( 0, "Test", "Select a window to test." ) Do Until _IsPressed(01) Sleep ( 500 ) $sTitle = WinGetTitle ( "[ACTIVE]" ) $aPos = WinGetPos ( "[ACTIVE]" ) IniWrite ( "config.ini", $sTitle, "X", $aPos[0] ) IniWrite ( "config.ini", $sTitle, "Y", $aPos[1] ) IniWrite ( "config.ini", $sTitle, "W", $aPos[2] ) IniWrite ( "config.ini", $sTitle, "H", $aPos[3] ) I'm trying to store a window title and associated information into an ini file using IniWrite(). Notepad++ seems to break the [section]. Can somebody help me find a way around this issue? I appreciate any help. Edit: Not FileWrite(), I'm sorry. I was in a rush to send this forum post before I had to leave somewhere. I meant IniWrite() Edited December 3, 2022 by D3fr0s7 Correction to original question Link to comment Share on other sites More sharing options...
Developers Jos Posted December 2, 2022 Developers Share Posted December 2, 2022 The posted script is confusing as there is no FileWrite() in it and what exactly is the relation to Notepad++? Try to explain your issue is a way we can understand and replicate it. 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...
D3fr0s7 Posted December 3, 2022 Author Share Posted December 3, 2022 I'm working on a script that will save window titles and their positions into an ini file for later use. It was going good until IniWrite() tried to write a window title that contained brackets in it, as I've just found I was able to replicate with a regular notepad file, the name of which is "File with [brackets] in the name.txt" so now that I was able to sit down and mess with the program a little, I've found that window titles that contain brackets seem to be ruining the IniWrite() function's job. Is there a way around this issue? NotePad++ isnt the problem, it was that the title of the program that I happened to use and that broke my script was titled "Notepad++ [administrator]" and it was the brackets, not necessarily the Notepad++ program that caused it. Attached is a picture of the inifile that this creates a problem in: I'd appreciate any suggestions to get around this issue. Link to comment Share on other sites More sharing options...
Nine Posted December 3, 2022 Share Posted December 3, 2022 Before writing the title in the ini file, just escape the brackets with some other characters, and on reading bring back the original brackets ? D3fr0s7 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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