Re: String to list conversion
Re: String to list conversion
- Subject: Re: String to list conversion
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 14 Sep 2004 12:23:54 -0700
On 9/14/04 11:45 AM, "John W. Baxter" <email@hidden> wrote:
>> So that Gnarlie (who asked the question in the first place) will know how to
>> populate her default list for when the user's .plist is empty of AppleScript
>> formatting entries. It may not be the only way of doing things - I guess she
>> can just figure it out from the UI for AS Format prefs - but it would have
>> been quicker to just fetch them from somewhere, if available. I had wondered
>> whether maybe you knew where this was in order to write your own "AS format"
>> commands in Smile. Since I asked you, Chris N. has replied that "Hopefully,
>> Smile is using the API to get the styles, so it doesn't have to know where
>> they're stored." If that's correct, what API is he referring to? Chris's
>> other statement that the defaults are currently "hardcoded" (presumably in
>> the AppleScript.component somewhere) would mean they'd be inaccessible to
>> ordinary users and scripters. These APIs would be Carbon routines to get
>> inside the component?
>
> 1. It is *likely* possible if one is dealing with one's own machine to make
> a non-change change to the formattting preferences (that is, change
> something and change it back). [A possible implementation would notice that
> the change just made to the preferences returned them to the default state
> and discard the plist file. I would not expect the programmers to have
> bothered, particularly since the default state varies by localization of the
> machine. That's why the *likely*.]
Even if this worked, why do you expect it to vary by localization? (I am
aware that most defaults do start with a defaults-by-localization. It's just
that in this case i don't think there should be any difference. Even the
names of the fonts must be standard, don't you think?] It's too late for
Gnarlie in her main user, since she's already customized it, but I guess she
could try in a new user.
Also, I wonder if you've noticed that earlier in the thread I stated that I
_do_ have an "~/Library/Preferences/com.apple.applescript.plist" file, but
the only key it has is <key>ChooseAppBounds</key>. Presumably, that would be
because I stretched the dimensions of the Script Editor window before
quitting - or something else. It's not actually in the Script Editor prefs
anywhere.
So it's possible to have plist file and still no recorded formatting prefs.
That's how Gnarlie's first attempt failed OMM.
>
> 2. Item 1 isn't helpful if Gnarlie is trying to write a script which will
> work on any machine.
>
> 3. The right way for code to learn the formatting preferences is to ask the
> scripting component for them. It's been years since I cared...I once knew
> what the API call and result looked like, but what I knew is likely stale
> anyhow.
It sounds like there's a current one, however.
>
> 4. It would certainly be possible to write a scripting addition which
> obtains the information using the API. I don't plan to.
Not worth the bother, I shouldn't think.
>
> Since there's already an active bug whose outcome will be that there is
> always a plist file, there's not much point in expressing fresh wishes for
> that.
True.
--
Paul Berkowitz
_______________________________________________
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