Re: Empty Record
Re: Empty Record
- Subject: Re: Empty Record
- From: Luther Fuller <email@hidden>
- Date: Tue, 12 Apr 2011 07:53:09 -0500
On Apr 12, 2011, at 4:46 AM, Nigel Garvey wrote:
> Luther Fuller wrote on Mon, 11 Apr 2011 15:02:14 -0500:
>
>> This ought to be an easy question ...
>>
>> set emptyString to "" -- easy
>> set emptyList to {} -- easy
>> set emptyRecord to {} as record -- No! This does not work.
>>
>> but, I have been trying for awhile now, and can't find a way to create
>> an empty record.
>> Does anyone know how to do this?
>
> Hi, Luther.
>
> set emptyRecord to {}
>
> I don't know how it affects your plist, but in AppleScript, an empty
> record and an empty list are the same thing.
The secret to understanding this problem is this phrase at the end of my original post:
> The record will end up being written to a .plist file
An empty list is written to a .plist file as an 'array' (= list) not a 'dictionary' (= record).
In a .plist file, these are not the same thing and would cause confusion to any user of the application who edits the file with Property List Editor.
I will, therefore, continue to use my work-around. It reliably creates an empty dictionary.
_______________________________________________
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