XML: Is there a simpler way of doing this?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chinagreenelvis
Posts: 133
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 (v1)”

Who is online

Users browsing this forum: prototype_zero, ulysim and 319 guests