XML Editing - set Value with System Events
XML Editing - set Value with System Events
- Subject: XML Editing - set Value with System Events
- From: "email@hidden" <email@hidden>
- Date: Sun, 08 Apr 2012 10:01:49 +1000
Hi I am trying to modify an element value in an XML.I am using the base script below but the value is not being written to the file.
Any help would be most appreciated.
Regards, Adrian
Sample.xml
<?xml version="1.0" encoding="UTF-8" ?> <ImageTransformList> <MediaRef>/media/dbone/Left/18_01/1920x1080/12345.tiff</MediaRef> <RefId>12345.tiff</RefId> </ImageTransformList>
Applescript:
set currentFile to "Users:doglight:Desktop:Sample.xml"
set theXMLa to POSIX path of (currentFile)
tell application "System Events" set theXMLb to XML file theXMLa tell contents of theXMLb set hello to "3"
set (value of XML element "MediaRef" of XML element "ImageTransformList" of XML file theXMLb) to hello
end tell
end tell
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden