Re: Records
Re: Records
- Subject: Re: Records
- From: "Nigel Garvey" <email@hidden>
- Date: Thu, 29 Sep 2005 01:51:45 +0100
Martin Orpen wrote on Wed, 28 Sep 2005 22:28:31 +0100:
>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)
The problem with this method on my machine is that the error message, the
user (barred) labels, and the string values all come out as black. Only
the values 'true' and 'false', and the 'string' in the error message, are
in my colour for application keywords. If the labels weren't barred,
they'd have the same application keyword colour as the 'true' and 'false'
values. Also, getting the individual 'words' won't suit multi-word labels.
>But, this has thrown up a peculiar problem. The script doesn't return all of
>the names:
>
>-->
>{
> "FBFaceSubFamilyName",
> "FBFaceCopyrightName",
> "FBFaceIsEnabled",
> "FBFaceUniqueName"
>}
It doesn't look as though these particular labels _are_ barred on your
machine. I'm surprised they are on mine. It only happens with Font Book.
Maybe my copy has a problem. (?)
>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*?
I'm seeing the same thing here. TextEdit doesn't return any 'words'
beyond the middle of a date in one of the string values. Using
'attribute' runs is more successful and would suit multi-word labels, but
would still give the wrong results with certain keyword values.
NG
_______________________________________________
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