Closed Heliophob closed 9 months ago
Thanks for your report. Please post an example template + script, which triggers this error.
See also 1. Link :)
var subject = this.mQuicktext.get_orgheader(["subject"]); var pattern = /TID#([0-9]{6})/i; var tid = pattern.exec(subject); if (!tid) var pattern = /TID#([0-9]{5})/i; var tid = pattern.exec(subject); if (!tid) return ""; // gibt nichts zurück else return tid[1]; // gibt die TID zurück
Please also add the template, which uses this script.
i use it with: [[SCRIPT=TID]]
eg. template: Bitte geben Sie bei Ihren Antworten immer die Ticket-ID an: [[SCRIPT=TID]]
Name from script is "TID"
The error you are seeing is inside a try...catch block, so Quicktext currently cannot connect to CardBook (or CardBook is not installed), but that does not prevent the rest of the code to work properly.
Your script does not work, because some internal parts are now async. You need to put "await" before the get_orgheader call:
// We need to await the async function call, otherwise we just get
// a Promise object and not a literal value.
var subject = await this.mQuicktext.get_orgheader(["subject"]);
// Lets check what we got.
mWindow.console.log({subject});
var pattern = /TID#([0-9]{6})/i;
var tid = pattern.exec(subject);
if (!tid)
var pattern = /TID#([0-9]{5})/i;
var tid = pattern.exec(subject);
if (!tid)
return ""; // gibt nichts zurück
else
return tid[1]; // gibt die TID zurück
many many thanks ! It works!
Hello,
Unfortunately, the update version 5.14 didn't help in my case. The scripts still don't work for me. See also here: https://github.com/jobisoft/quicktext/issues/379#issuecomment-1749538512
In the console I get the following error message: No chrome package registered for chrome://cardbook/content/cardbookRepository.js CURSOR LOG failedSearchAttempts : 1 quicktext.js:609:15
Note: I don't have CardBook installed (at least not by me manually but possibly by Thunderbird at the factory?). Of course, since I don't have it installed, I can't uninstall it! The same error also occurs if I deactivate all other plugins and only leave Quicktext switched on!
See also here: https://github.com/jobisoft/quicktext/issues/379#issuecomment-1756206378
Best Regards & THX!