Flash Screen

I am looking to replicate the flash screen alert option as found in the System Prefs > Universal Access "Hearing" pane but can't figure it out. I did find a script that will press the keyboard combo to invert the colors and back...

tell application "System Events" to repeat 2 times
key code 28 using {command down, control down, option down}
delay 0
end repeat

...but that's not the effect I'm looking for. Any ideas? I did also find a cocoa command called FlashMenuBar ( http://cocoadev.com/index.pl?FlashScreen ) but I'm not sure if this is something that can be called via Applescript.

Any ideas? I don't want to UI script the pref pane to click the flash screen button. I'd like it to be a standalone app.

Thanks,
Matt

Powerbook G4, Mac OS X (10.4.8)

Posted on Jan 25, 2007 10:10 AM

Reply
7 replies

Jan 26, 2007 10:36 AM in response to Hiroto

I tried it but it doesn't work. Can you explain the script?

This is the error when run:

Can't locate Mac/Menus.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

Jan 26, 2007 8:25 PM in response to Matt Binkowski

Oops.

The error message means Perl compilation failed because the specified Perl module Mac::Menus could not be found...
The posted Perl code works fine with MacPerl 5.6.1r2 under OS9.1. However, it seems it won't work under OSX.

(The Perl code simply invokes MacOS's Toolbox function 'FlashMenuBar(0)' twice in sequence, as explained in:
Toolbox Essentials >...> FlashMenuBar

or in Carbon Menu Manager Reference (pp. 52-53 of pdf):
MenuManager/menu_managerref.pdf
Menu_Manager/index.html
)

---
As far as I've searched briefly, this route via Perl (currently) won't lead you to the goal under OSX. Although there exists a Mac::Carbon module in CPAN, Menu Manager routines seem not implemented (yet).

cf.
perlmacosx.1.html
perlmacos.1.html

http://www.cpan.org/
http://search.cpan.org/modlist/OperatingSystemInterfaces/Mac
http://search.cpan.org/~cnandor/Mac-Carbon-0.77/Carbon.pm

Sorry for my wrong pointer.
Hiroto



Mac OS 9.1.x

Jan 26, 2007 9:40 PM in response to Hiroto

Hello,

You may try something like this also.
(Not tested either, for I don't use OSX for myself. But similar scripts work just fine under OS9.)

Good luck,
H


-- SCRIPT1
set volume output muted true
beep 1
set volume output muted false
-- END OF SCRIPT1


-- SCRIPT2
set _m to output muted of (get volume settings)
set volume output muted true
beep 1
--set volume output muted false
set volume output muted _m -- restore the original
-- END OF SCRIPT2



Mac OS 9.1.x

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Flash Screen

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.