Re: pList read and write
Re: pList read and write
- Subject: Re: pList read and write
- From: Stan Cleveland <email@hidden>
- Date: Wed, 07 Apr 2010 17:44:46 -0700
- Thread-topic: pList read and write
On 4/7/10 5:09 PM, "Luther Fuller" wrote:
> On Apr 7, 2010, at 5:03 PM, Oakley Masten wrote:
>> Hello again all.
>> You did such a great job of helping me with the creating pList files using
>> AppleScript that I just have to ask another question.
>> Is it possible to write and read pList files from the "Resources" folder
>> inside a script bundle?
>> I know you can write and read scripts in the bundle but can it be done for
>> pLists?
>> I have not been able to do it yet.
>
> Your application knows its internal structure, so if you have a plist file you
> want to read/write, you will need an alias to the file, like this ...
>
> set fileAlias to (((path to me) as text) & ":Contents:Resources:myfile.plist")
> as alias
>
> Now, you can read or write the file with System Events.
Hi Oakley,
Luther's suggestion works fine, but here's something even easier. Any script
saved as an application bundle or compiled script bundle will understand
this command and return an alias to the file:
set plistPath to path to resource "myfile.plist"
--> alias "Mac HD:Users:stanc:myscript.app:Contents:Resources:myfile.plist"
HTH,
Stan C.
_______________________________________________
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