Re: Quark style and character sheets -- is "normal" always spec number 1?
Re: Quark style and character sheets -- is "normal" always spec number 1?
- Subject: Re: Quark style and character sheets -- is "normal" always spec number 1?
- From: email@hidden
- Date: Mon, 5 Aug 2002 14:38:07 EDT
-----It appears that email@hidden wrote, on 20020803 1:04 AM:
>
that crashed my Mac too. So I'm curious, does:
>
>
delete every style spec whose index is not 1
>
>
actually work? I'd try it but I'm too scared....
Fear not! (easy for me to say, eh?)
I am still stumped as to why I _sometimes_ have problems with deleting
style (and character) specs when filtering by name. It seems to occur
more frequently on my client's machines (naturally!), but every now and
then it fails on my workstation too.
Though it rarely causes a crash, what often happens is that it _renames_
the style sheet, usually with a null value. After the script runs, I'll
see that the style palette shows "empty" definitions -- they are there,
but there is no name! Weird!
Anyway, that is what led me to seeing if referencing them by index might
avoid this problem. So far, all the documents I've checked (almost 100)
show the "Normal" style and character specs have an index of 1. That's
almost convincing enough, eh?
Anyway, here are the two methods I have employed to delete all but
"Normal."
-- address spec by name:
tell document 1
if exists (first style spec whose name is not "Normal") then
delete (every style spec whose name is not "Normal")
end if
if exists (first character spec whose name is not "Normal") then
delete (every character spec whose name is not "Normal")
end if
end tell
-- address spec by index:
tell document 1
if exists style spec 2 then delete (every style spec whose index is
not
1)
if exists character spec 2 then delete (every character spec whose
index is not 1)
end tell
I have yet to perform tests of the new (index) method on my client's
machine, but I will get to that shortly.
Cheers,
Dan Feather
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=- Dan at featherweightstuff dot com -=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.