• 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
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: email@hidden
  • Date: Fri, 7 Apr 2006 07:59:07 +0100

Hi,

I am trying to create an XML version of a file using XML suite, and have run into an issue where the following works:
------------------------------------------------
set xmlFile to (choose file) as Unicode text

tell application "System Events"
   set titleValue to value of XML element "title" of XML element "channel" of XML element "rss" of contents of XML file xmlFile
   display dialog "the title is " & titleValue
end tell
------------------------------------------------

but the code I want where a POSIX path is used to identify the file to process, rather than having the user select it through a dialog, shown below, does not work, even when the same file is processed in both cases:
------------------------------------------------
set xmlFile to read file ("/valid/path/to/file/RSS.xml" as POSIX file)

tell application "System Events"
   set titleValue to value of XML element "title" of XML element "channel" of XML element "rss" of contents of XML file xmlFile
   display dialog "the title is " & titleValue
end tell
------------------------------------------------

Running the second code snippet generates an NSReceiverEvaluatonScriptError. 
Questions:
- Can anyone shed any light on what the difference between output of the two selection processes is?
- What do I need to do to get the second code snippet working as expected!

cheers

Will
 _______________________________________________
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

  • Prev by Date: check file
  • Next by Date: RE: Shell script to extract time
  • Previous by thread: Re: check file
  • Next by thread: Re: (no subject)
  • Index(es):
    • Date
    • Thread