Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use QM to quickly modify the keys and values ​​in a plist file
#7
are you wanting to remove <key>key9</key>
or 
<string>string6</string>
or both
<key>key9</key>
and
<string>string6</string> ??????

here is what you wanted to do not sure you will understand the code though

Code:
Copy      Help
IXml x._create
x.FromFile("$desktop$\plist_file\file.plist")
int t tt
ARRAY(IXmlNode) a b; int i
x.RootElement.GetAll(0 a)
for i 0 a.len
,IXmlNode n=a[i]
,if(!StrCompare(n.Value "key20"))
,,t=1
,if(!StrCompare(n.Value "key7"))
,,n=n.Next
,,if(!StrCompare(n.Name "false"))
,,,n.Name="true"
,if(!StrCompare(n.Value "key9"))
,,x.Delete(n);; remove <key>key9</key>
,,n=a[i+1]
,,if(!StrCompare(n.Name "string"))
,,,x.Delete(n);; remove <string>string6</string>
if(t!=1)
,x.Path("plist/dict/dict").GetAll(0 b)
,for i 0 b.len
,,sel b[i].Name
,,,case "key"
,,,if(!StrCompare(b[i].Value "key5"))
,,,,IXmlNode iafter
,,,,iafter=b[i+1]
,,,,b[i].Parent.Insert(iafter "string" "string20")
,,,,b[i].Parent.Insert(iafter "key" "key20")                
x.ToString(_s)
out _s


Messages In This Thread
RE: use QM to quickly modify the keys and values ​​in a plist file - by Kevin - 08-20-2018, 07:25 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)