Here's another nifty hack. On newer Macs and newer Mac OS, open the
Keyboard Control Panel, select Function Keys, and make sure the checkbox
for "Use F1 through F15 as Hot Function Keys" is NOT checked. Save this
AppleScript as a Classic Applet (Never Show Startup Screen, and Do NOT Stay
Open). Set this AppleScript applet for F10. (Why does it go to F10? I
have no idea.)
Then scan away! Your scanned data will be placed in the clipboard. Note
that if the data does not go through to the AppleScript properly the first
time, then the script asks you to try again. It seems to work in my tests.
on run
set myScan to text returned of ¬
(display dialog "Scan, Please" default answer "")
if (the first character of myScan is not "." and ¬
the second character of myScan is not "C") then
set myScan to text returned of ¬
(display dialog "Scan Again, Please" default answer "")
end if
tell application "MacPerl"
activate
set the clipboard to (Do Script ["#!perl -w
use Barcode::Cuecat;
my $bc = new Barcode::Cuecat;
my $data = $ARGV[0] or exit;
$bc->scan($data);
MacPerl::Reply(sprintf q[%s: %s], $bc->type,
$bc->code);
# if you don't want the type in the returned string,
# use the line below instead of the one above
# MacPerl::Reply($bc->code);
", myScan])
end tell
end run
--
Chris Nandor [EMAIL PROTECTED] http://pudge.net/
Open Source Development Network [EMAIL PROTECTED] http://osdn.com/