Hi, you can get your own variables with Action-Tasker-TestTasker, Type: Global Variables. I do not think, that you can get a list of the build in variables
There's a complete list of the builtin global variable names in the Variables section of the userguide.
There's a complete list of the builtin global variable names in the Variables section of the userguide.I know. But I'm talking about programmatically getting that list from within Tasker, in real time.
Getting the values is no problem if you have the names...
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
/*global document, DOMParser*/
(function(DOMParser) {
"use strict";
var DOMParser_proto = DOMParser.prototype
, real_parseFromString = DOMParser_proto.parseFromString;
// Firefox/Opera/IE throw errors on unsupported types
try {
// WebKit returns null on unsupported types
if ((new DOMParser).parseFromString("", "text/html")) {
// text/html parsing is natively supported
return;
}
} catch (ex) {}
DOMParser_proto.parseFromString = function(markup, type) {
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
var doc = document.implementation.createHTMLDocument("")
, doc_elt = doc.documentElement
, first_elt;
doc_elt.innerHTML = markup;
first_elt = doc_elt.firstElementChild;
if (doc_elt.childElementCount === 1
&& first_elt.localName.toLowerCase() === "html") {
doc.replaceChild(first_elt, doc_elt);
}
return doc;
} else {
return real_parseFromString.apply(this, arguments);
}
};
}(DOMParser));
/* END of DOMParser HTML extension */
/**********************************************************************/
function filterGlobalVars(data) {
var list = [];
var match = [];
var regex = /(%[A-Z]+)/g;
try {
var parser = new DOMParser();
var doc = parser.parseFromString(data, 'text/html');
var nlist = doc.getElementsByTagName("I");
for (i = 0; i < nlist.length; i++) {
text = nlist[i].innerText;
while ((match = regex.exec(text)) != null) {
list.push(match[0]);
}
}
} catch (e) {
return e.message;
}
return list;
}
/**********************************************************************/
function getHttp() {
var http = new XMLHttpRequest();
var url = "http://tasker.dinglisch.net/userguide/en/variables.html"
http.open("GET", url, false);
http.send();
if (http.status = 200) {
return (http.responseText);
}
else {
return false;
}
}
/**********************************************************************/
// main
var data = getHttp();
var list = filterGlobalVars(data);Hi, this JavaScript filters the names of the global Variables from the Userguide:
[ ... ]
Maybe this helps someone...
Juergen.