from what you say one understands that you only care if there is a difference and not the exact difference of the strings (which is a complex thing to show, eg. for strings abc and acef one way to specify the difference would be d2..2a3..4af ie. delete characters in range 2..2 then add characters af in range 3..4)Shure
Some apps "forget" accessibility services sometimes, so I have set old var to enabled accessibility services and then run a macro in certain intervals that set the services in new var
I would then like to check for differences
Hope this makes sence
Yeah I think thats what I want
for a true MD solution that does not need many 100s of lines of codeFound a little workaround
When I compare my two var's with 'if/else' I made a popup with "No change" if they are equal, else "Changed"
If there is a change I run another macro that opens an app called "DiffFinder 2" and with some UI actions copy/paste the two var's in this app and compare them
It actually works
Still trying to figure out a more elegant solution, I am not a big fan of UI actions
Thanks for your time guys
You are absolutly right, I have spent a lot of time to find some, but no luck yetfor your case at the moment a thought about free public web api that compares strings, it's better than UI actions
great idea to use diffRight now I'm fooling around with thoughts about using MD's 'shell script', I have written the var's to two files and will try to use 'diff' and see if I can get this to work
New array/dictionary feature would be perfect for you but you would need to sort both old and current lists and then compare each item.Right now I'm fooling around with thoughts about using MD's 'shell script', I have written the var's to two files and will try to use 'diff' and see if I can get this to work
I get your point, it sounds ok@Snurre
your strings should have all services separated by a single character,
preferably a \n (new line) so you can see nicely the services line by line
then you do the following
1.write the strings to files old.txt and new.txt
2. using shell script(s) you do
sort old.txt > old_sorted.txt
sort new.txt > new_sorted.txt
comm -23 old_sorted.txt new_sorted.txt > deleted.txt
comm -13 old_sorted.txt new_sorted.txt > added.txt
and finally you have in
deleted.txt = services deleted
added.txt = services added
problem solved
Text manipulation action can do this automatically.I get your point, it sounds ok
BUT then I still have to manually edit the files with new line, before I can use it in scripts
Yeah but I can't see how in this paticular issueText manipulation action can do this automatically.
It's quite impossible to compare anything this way. Why don't you have any new lines? How do you get these string variables?Yeah but I can't see how in this paticular issue
Try to have a look at the string in post #8 and pls give me a hint