I am trying the following:
I have an external program which is running in background mode, whenever I hit F8 it tries to convert whatever is currently highlighted to a telephone number and opens my call-manager.
I have a web application that displays a bunch of numbers and I came up with this script to select one number:
jQuery(function($) {
//image that's displayed before number
$('.markTel').live("click",function() {
var myID = $(this).attr('data-rel');
SelectText(myID+'_tel');
});
});
function SelectText(element) {
var doc = document
, text = doc.getElementById(element)
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
}
This works like a charm, now I hit F8 and my call-manager starts to work.
Is there any way I can automatically trigger the call of the call-manager with the mouse click (lazy end-user)? I know there are scripts where I can "simulate" a keypress, but this only works within the browser, how can I start an external program?
I don't mind if reg-keys are required as it is only a few local computers in an offline enviroment I can setup.
Any hint is appreciated, thank you
In the near future, support for "phone number" weblinks & dialling will rapidly improve. HTML5 now supports "telephone number" links (eg. <a href='tel:+13174562564'>
) which are diallable, for mobile-phone support.
Maybe now, or in the near future, your dialler will add support for these? Feel free to ask/prompt the vendor for this, since this is the proper way to integrate & vendors know HTML5/ telephony is coming.. They're probably already working on it!
But as for scripting it, browsers deliberately are & should be barred from activating external software, because starting external software would enable malicious webpages to initiate all kind of virus/ malware behaviours.
You'll need a program/service installed on the computer separately to enable this.
There is some exception to this blanket prohibition -- if you enable & authorize explicit ActiveX/ Java applet/ Adobe Flash components, you can accomplish 1) some (limited) local interaction, 2) within the scope of what you can deploy & authorize & is compatible, and 3) within the limits of what the chosen component/plugin platform allows.
Generally neither applets nor ActiveX are great technology to rely on for widespread usage, both have many problems & drawbacks and permissioning/signing the things to authorize sufficient privileges to work your dialler will take quite some work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.