• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: syntax problem for reading an xml file in a bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: syntax problem for reading an xml file in a bundle
      • From: Graham Anderson <email@hidden>
References: 
 >syntax problem for reading an xml file in a bundle (From: Graham Anderson <email@hidden>)

  • Prev by Date: Re: Terminal grep from AS
  • Next by Date: Search Strings
  • Previous by thread: syntax problem for reading an xml file in a bundle
  • Next by thread: Re: syntax problem for reading an xml file in a bundle
  • Index(es):
    • Date
    • Thread