so i want to use KM to execute a command every 5 seconds that is a text file in XML format, extract specific parts from it and send it to variable or text file
Yes, KM definitely does stuff like this. Here's a sample macro that shows how to extract the Artist and Name fields from a variable with the kind of output you listed and send them into their own variables:
@gglick This is EPIC
thx so much for the guidance
Some additional questions arose if you done mind
(Below in the screen shot is the current state of the macro)
I cant seem to get the macro to execute every few seconds only manually, any clue what im missing here?
i want to write the different variables into a text file. i have tried the write variable actions yet i cant seem to find whats the best way to clear the text file and then add the different variables with spaces between them (or even better with use defined separators) ie "Artist-Name")
the regex fu is waay above my level if i wanted to add a 3rd variable ("album") can you guide me how to do so or decipher the regex
You're welcome. Glad you're happy with it. To tersely answer your other questions:
Based on the "when macro group is active" message in your screenshot, I'm guessing your macro is in a macro group that is not set to be active in all windows and applications. Try moving it to the default Global Macro Group and seeing if that doesn't resolve it.
I'm unsure what you mean by "clear the text file", but assuming you want to keep adding to a single text file rather than erasing it and starting over every time the macro runs, I believe you should stick with all Append to File actions rather than the one Write to File you currently have for Artist. As for spacing and separators, I would use Append Text rather than Append Variable, as that lets you use as many line breaks or other separators you want. Example:
Try this modified regex: (?s)<Item Name="Artist">([^<]+)</Item>.*<Item Name="Album">([^<]+)</Item>.*<Item Name="Name">([^<]+)</Item>
and make sure the corresponding action is set up like this: