XML: Is there a simpler way of doing this?

Get help with using AutoHotkey and its commands and hotkeys
chinagreenelvis
Posts: 32
Joined: 19 Oct 2015, 16:21

XML: Is there a simpler way of doing this?

14 Jun 2018, 22:32

Code: Select all

SysGet, Monitor, Monitor
XMLFile = %A_AppData%\Winamp\studio.xnf
FileRead, XMLData, %XMLFile%
XML := ComObjCreate("MSXML2.DOMDocument.6.0")
XML.async := False
XML.loadXML(XMLData)
XMLNodes := XML.selectNodes("//entry")
For XMLNode in XMLNodes
{
	Loop % XMLNode.attributes.length
	{
		AttName := XMLNode.attributes[A_Index-1].nodeName
		AttValue := XMLNode.attributes[A_Index-1].text
		If (AttValue = "Bento_isMainWndMaximized")
		{
			Text := XMLNode.getAttribute("value")
			MsgBox %Text%
			XMLNode.setAttribute("value", 0)
		}
		If (AttValue = "Bento_nomax_w")
		{
			Text := XMLNode.getAttribute("value")
			MsgBox %Text%
			XMLNode.setAttribute("value", %MonitorRight%)
		}
		If (AttValue = "Bento_nomax_h")
		{
			Text := XMLNode.getAttribute("value")
			MsgBox %Text%
			XMLNode.setAttribute("value", %MonitorBottom%)
		}
	}
	XML.Save(XMLFile)

Return to “Ask For Help”

Who is online

Users browsing this forum: ahketype, Pepineros, swagfag, Wicked and 104 guests