Re: Records
Re: Records
- Subject: Re: Records
- From: Martin Orpen <email@hidden>
- Date: Wed, 28 Sep 2005 22:28:31 +0100
- Thread-topic: Records
on 27/9/05 23:13, Nigel Garvey at email@hidden wrote:
> I wrote such a beast a couple of years ago, if it's of any interest. Its
> main purpose was to get string representations of the top level labels in
> a record (records within records being regarded as values), but it's easy
> to splice these into a list with the values. I've checked it over for
> Tiger compatibility and have changed the output to Unicode text, but
> haven't had time to check it for style. :-)
[snip script]
Cheers Nigel, I knew you'd have a solution handy ;-)
Determined as I am to take an alternative path, I had a bit of fun with:
tell application "Font Book"
set a to item 1 of typefaces
set b to typeface additional info of a
end tell
try
b as string
on error errMsg
set the clipboard to errMsg
end try
tell application "TextEdit"
make new document at beginning of documents
end tell
tell application "System Events"
activate application "TextEdit"
tell application process "TextEdit"
key code 9 using {command down}
end tell
end tell
set myList to {}
tell application "TextEdit"
set foo to document 1
set t to count of words of foo
repeat with n from 1 to t
set c to color of word n of foo
if c is {0, 26214, 26214} then
set end of myList to word n of foo
end if
end repeat
end tell
myList
(my variable colour is probably peculiar to me, so it'll need to be
adjusted)
But, this has thrown up a peculiar problem. The script doesn't return all of
the names:
-->
{
"FBFaceSubFamilyName",
"FBFaceCopyrightName",
"FBFaceIsEnabled",
"FBFaceUniqueName"
}
The reason being that the value of the last record contains a date which
contains a comma and the script refuses to acknowledge that there are any
words in the TextEdit document after than comma :(
That strikes me as odd behaviour - or is it *expected*?
--
Martin Orpen
_______________________________________________
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
References: | |
| >Re: Records (From: "Nigel Garvey" <email@hidden>) |