On May 23, 2013, at 3:31 PM, Alex Hall wrote: Here's my wifi script, just so you can get an idea - all the scripts work about this way, though some have different keywords and some need more logic. Still, this is basically how it works:
#script: wifi status.scpt set template to "You are connected to $ssid at $signalStrength DbM."
property utilities : load script POSIX file "/Users/mehgcap/prog/apple scripts/utilities.scpt" property getResourceInfo : load script POSIX file "/Users/mehgcap/prog/apple scripts/getResourceInfo.scpt"
set wifiInfo to getWifiInfo() of getResourceInfo set keywords to {"$ssid", "$signalStrength"} set keywordReplacements to {(ssid of wifiInfo), (signal_strength of wifiInfo)} set template to str_replace(keywords, keywordReplacements, template) of utilities if not wifi_enabled of wifiInfo then set template to "Wifi is currently disabled." tell utilities speak(template) end tell #end script
I don't see any obvious source for the problem in that code. However, there's one last thing I can think ofbe sure your handler names don't conflict with terminology from applications, scripting additions, or AS itself. I will look into [script library utilities], but I want these to be distributable. Ideally, a user needs to just download the zip file, unzip it into ~/library/scripts/Voiceover, and that's it. They can assign them to keystrokes, assign them to keyboard commander commands (a VO thing), call them from the script menu, whatever, but there would be no installation of any extra packages.
In this case, if I were me, I'd skip the library idea and just pull the handlers into your scripts. Libraries are great in a controlled environment, but not for distributing to others.
Regards, Stan C. -- "Software and cathedrals are much the same. First we build them, then we pray." -- Sam Redwine, Jr.
|