Re: syntax problem for reading an xml file in a bundle
Re: syntax problem for reading an xml file in a bundle
- Subject: Re: syntax problem for reading an xml file in a bundle
- From: Christopher Nebel <email@hidden>
- Date: Thu, 27 Jan 2005 17:16:29 -0800
On Jan 27, 2005, at 12:27 PM, Graham Anderson wrote:
I am trying to read an xml file located in my script's application
bundle
I am not running this within script editor as it would generate
erros....
set gLocalPrefFile to (((path to me) as string) &
"Contents:Resources:Data:!Fonovisa.xml")
set theScript to "sed -n
'/<launcherVer>/{s/.*<launcherVer>\\(.*\\)<\\/launcherVer>.*/\\1/p;}'
" & POSIX path of gLocalPrefFile
the xml file contains:
<?xml version="1.0" ?>
<preferences>
<launcherVer>1.0.0.37</launcherVer>
</preferences>
Knowing what error you're seeing would help. You might be having
quoting trouble with the file path, seeing as how you're not quoting it
at all -- say "quoted form of POSIX path of ..." instead.
--Chris Nebel
AppleScript Engineering
P.S.: Personally, I prefer saying
perl -ne 'print $1 if m|<launcherVers>(.*)</launcherVers>|'
...as I find it somewhat clearer, but that's a matter of taste.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden