| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jan 27, 2008, at 5:08 PM, Neil Faiman wrote:
Further investigation: You can't set the 'enabled' property of a font family, but you CAN set the enabled property of a typeface (which is the Font Book class name for an individual font in a family). This script enables the Lucida Bright Regular. tell application "Font Book" set enabled of typeface "lucida bright" to true end tell However, this tell application "Font Book" set enabled of (every typeface) to true end tell seems to go into an infinite loop. (Or maybe it really is taking that long to loop over all the fonts.) After some experimentation, I came up with the following solution: tell application "Font Book" repeat with f in (every typeface) set enabled of (f) to true delay 1 end repeat end tell What's the delay for, you ask? Now that's an interesting story. I tried the obvious loop: tell application "Font Book" repeat with f in (every typeface) set enabled of (f) to true end repeat end tell but that gives a bizarre result which looks a lot like a Font Book (or AppleScript) bug. Here's the event log: tell application "Font Book" count every typeface 471 set enabled of item 1 of every typeface to true set enabled of item 2 of every typeface to true current application "Font Book got an error: Can’t set item 2 of every typeface to true." If I had to guess, I'd say that Font Book is returning control to the script before it actually completes the operation, so that it trips over its own feet when it tries to execute the next operation. But that's just a guess. Anyway, the script above with the delay does appear to do what you want (slowly). Regards, Neil Faiman |
_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
| References: | |
| >Scripting Fontbook (From: Michael Curtis <email@hidden>) | |
| >Re: Scripting Fontbook (From: Neil Faiman <email@hidden>) | |
| >Re: Scripting Fontbook (From: Michael Curtis <email@hidden>) | |
| >Re: Scripting Fontbook (From: Neil Faiman <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.