I'm trying to write a script to recursively modify all XML files in a user profile folder. I'm not sure if this is a problem with my syntax in AHK or xpath. I suspect that it's either that it doesn't like the space or the @ in the path. My script and error message are below. The MsgBox is only for my debugging purposes and will be removed when it's done. Any assistance would be greatly appreciated.
AHK Script
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#include xpath.ahk
Loop, %A_AppData%\Pandion\Profiles\settings.xml, , 1 ; Recurse into subfolders.
{
xpath_load(%A_LoopFileFullPath%) ; load an XML document
xpath(xmlfile, "settings/history_store() ", "true")
MsgBox, 4, , Filename = %A_LoopFileFullPath%`n`nContinue?
IfMsgBox, No
break
xpath_save(%A_LoopFileFullPath%, feed) ; write XML
}
And here's the error
---------------------------
updatepandionlogging.ahk
---------------------------
Error: The following variable name contains an illegal character:
"\\server\RedirectedFolders\usernameremoved\Application Data\Pandion\Profiles\admin@chat.domain.local\settings.xml"
The current thread will exit.
Line#
448: }
449: StringReplace,doc,xml,,,,,All
450: NumPut(0, doc := " " . doc, 0, "UChar")
451: Return,true
452: }
020: Loop,%A_AppData%\Pandion\Profiles\settings.xml,,1
022: {
---> 023: xpath_load(%A_LoopFileFullPath%)
024: xpath(xmlfile, "settings/history_store() ", "true")
028: MsgBox,4,,Filename = %A_LoopFileFullPath%
Continue?
029: IfMsgBox,No
030: Break
033: xpath_save(%A_LoopFileFullPath%, feed)
035: }
035: Exit
---------------------------
OK
---------------------------