How to open an XML file within an OSX bundle?

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Wed Jun 20 07:39:30 EDT 2012


...thanks Colin.

I don't know if I'm getting anywhere with this yet. This is my script...

on mouseUp
   put empty into tFile
   put empty into field "Source File"
   put empty into field "Extract"
   answer file "Select File" as sheet
   put it into tFile
   put tFile into field "Source File"
   put quote & "binfile:" & tFile & "/Contents/info.plist" & quote into tTarget
   answer tTarget
   put URL tTarget into field "Extract"
   answer the number chars of field "Extract"
end mouseUp

...seems to create a well formed field path to the iPhoto plist file in tTarget, but it doesn't return the contents of the plist file into the Extract field (and the character count in the last line returns zero - just as a check that it's not returning invisible characters or hiding content that's within html tags)

So, I'm guessing that either direct access to the contents of files within packages is not allowed or that there is a syntax error in my 'put URL' line?
Best,
Keith..

On 19 Jun 2012, at 12:55, Colin Holgate wrote:

> With a stack saved in the Applications folder, this script puts the iPhoto info.plist XML file into field 1:
> 
> on mouseUp
>   put URL "binfile:iPhoto.app/Contents/info.plist" into field 1
> end mouseUp
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list